Question

I am working on signing in a Rails 2 app remotely. Given that Rails methods are RESTful by default, I am assuming all I have to do would be POSTing form data from the remote application (a Facebook App actually). For some reason, this doesn't seem to work, I've tried:

curl http://www.zouz.com/session -d user[email]=testing@blabla.com -d user[password]=whocares

which returns and empty result. I suspected Rails' built in forgery protection might be the cause, deactivating it won't make it work.

Is there something wrong with my method ?

EDIT : If it's any help, processing the same POST query with HTTPRequester does work, although I provided the same input.

Was it helpful?

Solution

I managed to get it working, thanks to the -u flag.

 curl --user testing@blabla.com:whocares http://192.168.1.19:3000

This is still cryptic to me, as I still don't know how it operates under the hood. Explanations are still welcome.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top