Our great sponsors
-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
>>> import json >>> import requests >>> endpoint = "http://httpbin.org/post" >>> myData = { ... "id": 1, ... "name": "Leanne Graham", ... "username": "Bret", ... "email": "[email protected]", ... "address": { ... "street": "Kulas Light", ... "suite": "Apt. 556", ... "city": "Gwenborough", ... "zipcode": "92998-3874", ... "geo": { ... "lat": "-37.3159", ... "lng": "81.1496" ... } ... }, ... "phone": "1-770-736-8031 x56442", ... "website": "hildegard.org", ... "company": { ... "name": "Romaguera-Crona", ... "catchPhrase": "Multi-layered client-server neural-net", ... "bs": "harness real-time e-markets" ... } ... } >>> r = requests.post(endpoint, data=json.dumps(myData)) >>> r.status_code 200
>>> r = requests.get("http://github.com", timeout=1) >>> r.encoding 'utf-8'