Sample code for 30+ languages & platforms
Visual FoxPro

Example: Http.HasRequestHeader method

Demonstrates the HasRequestHeader method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL loHttp
LOCAL b

loHttp = CreateObject('Chilkat.Http')

loHttp.SetRequestHeader("X-CSRF-Token","Fetch")

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

b = loHttp.HasRequestHeader("X-Something")
IF (b = 1) THEN
    ? "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 = loHttp.HasRequestHeader("Accept")
IF (b = 1) THEN
    ? "Accept: Yes"
ELSE
    ? "Accept: No"
ENDIF

* Output:

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

RELEASE loHttp