trying to POST with ruby mechanize

后端 未结 1 1922
無奈伤痛
無奈伤痛 2021-02-20 03:06

I\'ve captured the login HTTP headers using firefox plugin LiveHTTPheaders.

I\'ve found the following url and variables.

POST /login
email=myemail%40gmai         


        
1条回答
  •  执念已碎
    2021-02-20 03:31

    post() doesn't take a block. Try this:

    page = browser.post('http://www.mysite.com/login', {
      "email" => "myemail%40gmail.com",
      "password" => "something",
      "remember" => "1",
      "loginSubmit" => "Login",
      "url" => ""
    })
    

    edit: changed for accuracy

    0 讨论(0)
提交回复
热议问题