Sample code for 30+ languages & platforms
Chilkat2-Python

Example: Http.GetRequestHeader method

Demonstrates the GetRequestHeader method.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import chilkat2

success = False

http = chilkat2.Http()

hdr1 = "X-CSRF-Token"
hdr2 = "X-Example"

http.SetRequestHeader(hdr1,"Fetch")
http.SetRequestHeader(hdr2,"123ABC")

print(hdr1 + ": " + http.GetRequestHeader(hdr1))
print(hdr2 + ": " + http.GetRequestHeader(hdr2))

# Output:

# X-CSRF-Token: Fetch
# X-Example: 123ABC