python-post

#post
userinfo={'username':'jack','password':'123456'}
r=requests.post('http://httpbin.org/post',data=userinfo)
print(r.text)

输出结果

"C:\Program Files\Anaconda3\python.exe" "D:/pycharm/test2/python gaoji.py"
{
  "args": {}, 
  "data": "", 
  "files": {}, 
  "form": {
    "password": "123456", 
    "username": "jack"
  }, 
  "headers": {
    "Accept": "*/*", 
    "Accept-Encoding": "gzip, deflate", 
    "Connection": "close", 
    "Content-Length": "29", 
    "Content-Type": "application/x-www-form-urlencoded", 
    "Host": "httpbin.org", 
    "User-Agent": "python-requests/2.11.1"
  }, 
  "json": null, 
  "origin": "114.252.235.73", 
  "url": "http://httpbin.org/post"
}

 

posted @ 2019-01-18 17:02  Smilevv-45  阅读(145)  评论(0编辑  收藏  举报