cURL / Mailing Lists / curl-users / Single Mail

curl-users

Copying authenticity_token

From: Jerrold \ <jet_at_whidbey.com>
Date: Sun, 06 Jun 2010 19:43:32 -0700

I am making a first attempt to use curl. I am trying to do a
post to a rails app form...

I send a get request

   curl "http://0.0.0.0:3000/forgot_password"

In the response, I excerpt the following:

   <form action="" class="forgot-password" method="post"><div
class="hidden-fields"><input id="page_path" name="page_path"
type="hidden" value="users/forgot_password" /><input
name="authenticity_token" type="hidden"
value="b0dS1HZArYh21PgSR90Prws8wL/SRJRef/+lmBgqOz4=" />

...and

<input class="email-address email-address-input" id="email-address"
name="email_address" type="text" />

I extract the parameters from the above, and escape the special
characters ( + / = ) to form a curl post:

 
   curl -d
"email_address=me_at_world.com&page_path=users/forgot_password&authenticity_token=b0dS1HZArYh21PgSR90Prws8wL%2FSRJRef%2F%2BlmBgqOz4%3D"
0.0.0.0:3000/forgot_password

However, I am still getting a message for an invalid authenticity token.

Am I doing this correctly?

Jet

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-07