bitbucket rest api python example

Solutions on MaxInterview for bitbucket rest api python example by the best coders in the world

showing results for - "bitbucket rest api python example"
Giacomo
10 Sep 2018
1>>> url = "http://httpbin.org/post"
2>>> r = requests.post(url, data="myscreename:mypassword")
3>>> print r.text
4{
5  "args": {}, 
6  "data": "myscreename:mypassword", 
7  "files": {}, 
8  "form": {}, 
9  "headers": {
10    "Accept": "*/*", 
11    "Accept-Encoding": "gzip, deflate", 
12    "Content-Length": "22", 
13    "Host": "httpbin.org", 
14    "User-Agent": "python-requests/2.5.1 CPython/2.7.6 Darwin/14.3.0"
15  }, 
16  "json": null, 
17  "origin": "16.7.5.3", 
18  "url": "http://httpbin.org/post"
19}
20
21>>> r = requests.post(url, auth=("myscreename", "mypassword"))
22>>> print r.text
23{
24  "args": {}, 
25  "data": "", 
26  "files": {}, 
27  "form": {}, 
28  "headers": {
29    "Accept": "*/*", 
30    "Accept-Encoding": "gzip, deflate", 
31    "Authorization": "Basic bXlzY3JlZW5hbWU6bXlwYXNzd29yZA==", 
32    "Content-Length": "0", 
33    "Host": "httpbin.org", 
34    "User-Agent": "python-requests/2.5.1 CPython/2.7.6 Darwin/14.3.0"
35  }, 
36  "json": null, 
37  "origin": "16.7.5.3", 
38  "url": "http://httpbin.org/post"
39}