mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
added cookie examples to README
This commit is contained in:
parent
be6ca03030
commit
7949eeb509
1 changed files with 16 additions and 0 deletions
16
README.rdoc
16
README.rdoc
|
@ -105,6 +105,22 @@ use whatever proxy the system is configured to use:
|
|||
|
||||
RestClient.proxy = ENV['http_proxy']
|
||||
|
||||
== Cookies
|
||||
|
||||
Request and Response objects know about HTTP cookies, and will automatically
|
||||
extract and set headers for them as needed:
|
||||
|
||||
response = RestClient.get 'http://example.com/action_which_sets_session_id'
|
||||
response.cookies
|
||||
# => {"_applicatioN_session_id" => "1234"}
|
||||
|
||||
response2 = RestClient.post(
|
||||
'http://localhost:3000/',
|
||||
{:param1 => "foo"},
|
||||
{:cookies => {:session_id => "1234"}}
|
||||
)
|
||||
# ...response body
|
||||
|
||||
== Meta
|
||||
|
||||
Written by Adam Wiggins (adam at heroku dot com)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue