mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Updating the readme to include examples of how to set headers for requests.
This commit is contained in:
parent
26b5ff3ba2
commit
a7cd8fec88
1 changed files with 11 additions and 0 deletions
11
README.rdoc
11
README.rdoc
|
@ -249,6 +249,17 @@ the URL for GET, HEAD and DELETE requests, escaping the keys and values as neede
|
|||
RestClient.get 'http://example.com/resource', :params => {:foo => 'bar', :baz => 'qux'}
|
||||
# will GET http://example.com/resource?foo=bar&baz=qux
|
||||
|
||||
== Headers
|
||||
|
||||
# GET request with modified headers
|
||||
RestClient.get 'http://example.com/resource', {:Authorization => 'Bearer cT0febFoD5lxAlNAXHo6g'}
|
||||
|
||||
# POST request with modified headers
|
||||
RestClient.post 'http://example.com/resource', {:foo => 'bar', :baz => 'qux'}, {:Authorization => 'Bearer cT0febFoD5lxAlNAXHo6g'}
|
||||
|
||||
# DELETE request with modified headers
|
||||
RestClient.delete 'http://example.com/resource', {:Authorization => 'Bearer cT0febFoD5lxAlNAXHo6g'}
|
||||
|
||||
== Cookies
|
||||
|
||||
Request and Response objects know about HTTP cookies, and will automatically
|
||||
|
|
Loading…
Reference in a new issue