{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3396","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3396/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3396/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3396/events","html_url":"https://github.com/kennethreitz/requests/issues/3396","id":165096806,"number":3396,"title":"JSON decode failed","user":{"login":"cchenship","id":12646348,"avatar_url":"https://avatars.githubusercontent.com/u/12646348?v=3","gravatar_id":"","url":"https://api.github.com/users/cchenship","html_url":"https://github.com/cchenship","followers_url":"https://api.github.com/users/cchenship/followers","following_url":"https://api.github.com/users/cchenship/following{/other_user}","gists_url":"https://api.github.com/users/cchenship/gists{/gist_id}","starred_url":"https://api.github.com/users/cchenship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchenship/subscriptions","organizations_url":"https://api.github.com/users/cchenship/orgs","repos_url":"https://api.github.com/users/cchenship/repos","events_url":"https://api.github.com/users/cchenship/events{/privacy}","received_events_url":"https://api.github.com/users/cchenship/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-12T14:38:03Z","updated_at":"2016-07-12T14:42:16Z","closed_at":"2016-07-12T14:40:43Z","body":"I want to do the following curl call in python with requests\r\n\r\n**curl:**\r\n`curl -b cookies -c cookies -X POST -d @auth 'https://api.a_website.com/auth'`\r\n\r\nThe above curl commanded worked.\r\nSo, I started migrating it into python 3.5.2.\r\n\r\n**python**\r\n```\r\nbase_url = 'https://api.a_website.com/auth'\r\nresult = requests.post(url=base_url, data={'auth': open('auth', 'rb')}, cookies=cookies)\r\nresult.content\r\n```\r\nHowever, I got the following error:\r\n\r\n> \r\nb'{\"response\":{\"error_id\":\"SYNTAX\",\"error\":\"JSON decode failed\",\"error_description\":null,\"service\":null,\"method\":null,\"error_code\":null,\"dbg_info\":{\"instance\":\"65.bm-hbapi.prod.nym2\",\"slave_hit\":false,\"db\":\"master\",\"awesomesauce_cache_used\":false,\"count_cache_used\":false,\"uuid\":\"c941819d5c860f9a\",\"warnings\":[],\"time\":39.22700881958,\"start_microtime\":1468334115.9092,\"version\":\"1.16.707\",\"slave_lag\":0,\"output_term\":\"not_found\"}}}\\n'\r\n\r\n\r\nhere is the auth file\r\n`$ cat auth`\r\n\r\n> {\r\n>     \"auth\": {\r\n>         \"username\" : \"a_username\",\r\n>         \"password\" : \"a_password\"\r\n>     }\r\n> }"},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/232069134","html_url":"https://github.com/kennethreitz/requests/issues/3396#issuecomment-232069134","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3396","id":232069134,"user":{"login":"cchenship","id":12646348,"avatar_url":"https://avatars.githubusercontent.com/u/12646348?v=3","gravatar_id":"","url":"https://api.github.com/users/cchenship","html_url":"https://github.com/cchenship","followers_url":"https://api.github.com/users/cchenship/followers","following_url":"https://api.github.com/users/cchenship/following{/other_user}","gists_url":"https://api.github.com/users/cchenship/gists{/gist_id}","starred_url":"https://api.github.com/users/cchenship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchenship/subscriptions","organizations_url":"https://api.github.com/users/cchenship/orgs","repos_url":"https://api.github.com/users/cchenship/repos","events_url":"https://api.github.com/users/cchenship/events{/privacy}","received_events_url":"https://api.github.com/users/cchenship/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T14:42:16Z","updated_at":"2016-07-12T14:42:16Z","body":"Thanks for the quick response, I was indeed using -d in curl, pasted the wrong line"}}
{"actor":{"display_login":"cchenship"}}