1
0
Fork 0
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:
Joshua J. Campoverde 2014-07-29 17:53:24 -07:00
parent 26b5ff3ba2
commit a7cd8fec88

View file

@ -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