문제

I have a web app with a clean RESTful JSON API, based on Rails 3.2, Ruby 1.9 and Devise 2.

I would like to write a small script based on HTTParty web client in order to perform some actions frequently (with a crontab). But how can we sign in and keep the session open (with the session id passed by HTTP HEADER, and maybe stored in a cookie).

I really have no experience about this aspect.

도움이 되었습니까?

해결책

According to this mailing list comment as of January, may not be possible:

https://groups.google.com/forum/#!searchin/httparty-gem/cookie/httparty-gem/H2me9zB1mEI/RNy3pdSzWnsJ

I personally started a project with HTTParty, and moved to RestClient because the behavior seems was more straightforward IMHO. Checkout the 'cookies' section of:

https://github.com/archiloque/rest-client

...may suite your needs.

Justin

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top