How do I send referer in get request?

L

Lutz Horn

Ace said:
I know how to do it in post but I don't know using GET.

How do you do it in a POST request? The HTTP headers should not be
diferent between GET and POST.

Lutz
 
A

Ace Mutha

Lutz said:
How do you do it in a POST request? The HTTP headers should not be
diferent between GET and POST.

Lutz


http = Net::HTTP.new('example.com', 80)

# POST request
data = 'searchaction=show&search=1'
headers = {
'User-Agent' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3',
'Cookie' => cookie,
'Referer' => 'Referer: http://plain-text.info/search/',
'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.post(path, data, headers)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top