(Xojo Plugin) Example: Http.HasRequestHeader method
Demonstrates the HasRequestHeader method.
Dim http As New Chilkat.Http
http.SetRequestHeader "X-CSRF-Token","Fetch"
Dim b As Boolean
b = http.HasRequestHeader("X-CSRF-Token")
If (b = True) Then
System.DebugLog("X-CSRF-Token: Yes")
Else
System.DebugLog("X-CSRF-Token: No")
End If
b = http.HasRequestHeader("X-Something")
If (b = True) Then
System.DebugLog("X-Something: Yes")
Else
System.DebugLog("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
System.DebugLog("Accept: Yes")
Else
System.DebugLog("Accept: No")
End If
// Output:
// X-CSRF-Token: Yes
// X-Something: No
// Accept: Yes
|