Redirection and/or wrong request type with WWW:Mechanize and a rails app
44 views
Skip to first unread message
Maciej B
unread,
Feb 1, 2013, 8:47:49 AM2/1/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to www-mecha...@googlegroups.com
Hello,
I'm trying to use WWW::Mechanize to navigate through a rails app and I've encountered some strange behaviour. The application gives the administrative user the option to impersonate another user by following the route POST /owners/ownerid/impersonate, which I would like to use to automate some tedious manual tasks.
From within a WWW::Mechanize object I am using LWP::UA's post() method to try and emulate the browser, unfortunately when I do that I am being redirected to issue a GET request on the same resources with an auth token, which fails as there is no route to match a GET request like that, is there a way I could suppress that ? Am I doing something wrong ? The source of the element I'm trying to use is: