{"action":"opened","issue":{"url":"https://api.github.com/repos/kevinsawicki/http-request/issues/115","labels_url":"https://api.github.com/repos/kevinsawicki/http-request/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/kevinsawicki/http-request/issues/115/comments","events_url":"https://api.github.com/repos/kevinsawicki/http-request/issues/115/events","html_url":"https://github.com/kevinsawicki/http-request/issues/115","id":128341553,"number":115,"title":"How to automate login a website","user":{"login":"EmyrsIro","id":16850093,"avatar_url":"https://avatars.githubusercontent.com/u/16850093?v=3","gravatar_id":"","url":"https://api.github.com/users/EmyrsIro","html_url":"https://github.com/EmyrsIro","followers_url":"https://api.github.com/users/EmyrsIro/followers","following_url":"https://api.github.com/users/EmyrsIro/following{/other_user}","gists_url":"https://api.github.com/users/EmyrsIro/gists{/gist_id}","starred_url":"https://api.github.com/users/EmyrsIro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmyrsIro/subscriptions","organizations_url":"https://api.github.com/users/EmyrsIro/orgs","repos_url":"https://api.github.com/users/EmyrsIro/repos","events_url":"https://api.github.com/users/EmyrsIro/events{/privacy}","received_events_url":"https://api.github.com/users/EmyrsIro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-23T17:35:38Z","updated_at":"2016-01-23T17:35:38Z","closed_at":null,"body":"can someone guide me how i can automate login to a website using this library . in order to login cookies must be handled i have tried that .\r\n\r\nHttpRequest request = HttpRequest.get(\"http://website.com/\");\r\n\t\trequest.trustAllCerts();\r\n\t\trequest.trustAllHosts();\r\n\t\trequest.userAgent(\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1\");\r\n\t\trequest.useCaches(true);\r\n\t\tString cookies = request.header(\"Set-Cookie\");\r\n\t\tString response = request.body();\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tsb.append(\"email=clientemail%40gmail.com&password=clientpass&login_button=Login\");\r\n\t\tHttpRequest rq = HttpRequest.post(\"http://website.com/\").send(sb);\r\n\t\trq.header(\"Cookie\", cookies);\r\n        String html = rq.body();"}}