forms - Login with cURL using POST -
i have little experience curl, have login website using curl , think best way through post method, head url , request post, in same "navigation session", because can access other url logged in.
as far searched, need cookies file keep me logged in, used command that:
curl --cookie cookies.txt --request post 'http://example.com/' -f 'authenticity_token=tokenwithlettersnumbersandsymbols&uid=myusername&password=mypassword&commit=enter --request post 'http://example.com/subpage#40' -f 'commit=save'
but didn't work, maybe because of authenticity token, generated every time enter url, accessible in part of html:
<form action="/login/log" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="e2iis5+9p9baqke0gj4nvj5e+yhkgod2b9b1bj6vjnk=" /></div> <p><b>login:</b> <input id="uid" name="uid" type="text" /></p> <p><b>password:</b> <input id="password" name="password" type="password" /></p> <p id='submit'> </form> so how retrieve authenticity token value use in post request? also, post best way of doing this?
Comments
Post a Comment