rest-client headers or cookies

E

Ed Howland

Hi,

I am trying to make a request to a PHP application coded with limonade
(a REST sever like Sinatra). I'm using rest_client which rides on top
of Net::HTTP. I'd like to get the headers back from that call, so that
I can store the session cookie and pass it back on subsequent
requests.

I know how to set the headers for RestClient.get, but how do I get the
headerts from a RestCleint.post?

Thanks,
Ed
 
N

Nicholas Wieland

Hi -

Hi,
=20
I am trying to make a request to a PHP application coded with limonade
(a REST sever like Sinatra). I'm using rest_client which rides on top
of Net::HTTP. I'd like to get the headers back from that call, so that
I can store the session cookie and pass it back on subsequent
requests.
=20
I know how to set the headers for RestClient.get, but how do I get the
headerts from a RestCleint.post?

I don't think you want the headers of the GET or POST, but of the =
response, right ?
Did you try to assign the RestClient.get to a variable (that should be a =
Response) and call headers on it ?
Let me know if it works.

ngw
 
E

Ed Howland

I don't think you want the headers of the GET or POST, but of the respons= e, right ?
Did you try to assign the RestClient.get to a variable (that should be a =
Response) and call headers on it ?
Let me know if it works.

=A0ngw
Thanks,

That did the trick. I had believed that I was just getting
response.body from the call, but what apparently was happening was it
was auto-casting to a string. response.to_s is probably the same as
response.body.

Ed



--=20
Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top