Sample code for 30+ languages & platforms
Xbase++

Example: Http.HasRequestHeader method

Demonstrates the HasRequestHeader method.

Chilkat Xbase++ Downloads

Xbase++
LOCAL oHttp
LOCAL b

oHttp := CreateObject("Chilkat.Http")

oHttp:SetRequestHeader("X-CSRF-Token", "Fetch")

b := oHttp:HasRequestHeader("X-CSRF-Token")
IF (b == 1)
    ? "X-CSRF-Token: Yes"
ELSE
    ? "X-CSRF-Token: No"
ENDIF

b := oHttp:HasRequestHeader("X-Something")
IF (b == 1)
    ? "X-Something: Yes"
ELSE
    ? "X-Something: No"
ENDIF

//  The Accept and Accept-Encoding headers are default headers automatically added,
//  unless the application chooses to remove by calling RemoveRequestHeader for each.
b := oHttp:HasRequestHeader("Accept")
IF (b == 1)
    ? "Accept: Yes"
ELSE
    ? "Accept: No"
ENDIF

//  Output:

//  X-CSRF-Token: Yes
//  X-Something: No
//  Accept: Yes

oHttp:destroy()