Skip to content

Commit

Permalink
Documentation...
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhellsten committed Feb 5, 2011
1 parent 1f9bcc5 commit bf31154
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ h2. Usage

<pre>
<code>
headers = {
"User-Agent" => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13",
"Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
# GET
response = HTTP.get(url, :headers => headers)
# POST
response = HTTP.post(url, :parameters => {:a => :b}, :headers => headers)
# Detect encoding
encoding = HTTP.encoding(response)
headers = {
"User-Agent" => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13",
"Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
# GET
response = HTTP.get(url, :headers => headers)
# POST
response = HTTP.post(url, :parameters => {:a => :b}, :headers => headers)
# Detect encoding
encoding = HTTP.encoding(response)
</code>
</pre>

0 comments on commit bf31154

Please sign in to comment.