Sample code for 30+ languages & platforms
Lianja

Inspect HTTP Request Header

Demonstrates the LastHeader property.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loHttp = createobject("CkHttp")

lcUrl = "https://chilkatsoft.com/echo_request_body.asp"
lcJson = '{"greeting":"Hello World"}'

// Send a POST with the JSON in the HTTP request body.
loResp = createobject("CkHttpResponse")
llSuccess = loHttp.HttpStr("POST",lcUrl,lcJson,"utf-8","application/json",loResp)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loResp
    return
endif

// Examine the HTTP request header we just sent.
? loHttp.LastHeader

// Output:

// POST /echo_request_body.asp HTTP/1.1
// Host: chilkatsoft.com
// Accept: */*
// Accept-Encoding: gzip
// Content-Type: application/json
// Content-Length: 26


release loHttp
release loResp