1
0
Fork 0
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:
Lennon Day-Reynolds 2009-02-05 16:23:42 -08:00
parent be6ca03030
commit 7949eeb509

View file

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