Sample code for 30+ languages & platforms
Ruby

Example: Http.GetRequestHeader method

Demonstrates the GetRequestHeader method.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

http = Chilkat::CkHttp.new()

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

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

print hdr1 + ": " + http.getRequestHeader(hdr1) + "\n";
print hdr2 + ": " + http.getRequestHeader(hdr2) + "\n";

# Output:

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