Sample code for 30+ languages & platforms
B4X

Example: Http.HasRequestHeader method

Demonstrates the HasRequestHeader method.

Chilkat B4X Downloads

B4X
Dim http As ChilkatHttp
http.Initialize("http")


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

Dim b As Boolean = http.HasRequestHeader("X-CSRF-Token")
If b = True Then
    Log("X-CSRF-Token: Yes")
Else
    Log("X-CSRF-Token: No")
End If


b = http.HasRequestHeader("X-Something")
If b = True Then
    Log("X-Something: Yes")
Else
    Log("X-Something: No")
End If


'  The Accept and Accept-Encoding headers are default headers automatically added,
'  unless the application chooses to remove by calling RemoveRequestHeader for each.
b = http.HasRequestHeader("Accept")
If b = True Then
    Log("Accept: Yes")
Else
    Log("Accept: No")
End If


'  Output:

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