Answers for "REST APi using pyhton 3"

2

REST APi using pyhton 3

>>> import requests
>>> api_url = "https://jsonplaceholder.typicode.com/todos/10"
>>> todo = {"title": "Mow lawn"}
>>> response = requests.patch(api_url, json=todo)
>>> response.json()
{'userId': 1, 'id': 10, 'title': 'Mow lawn', 'completed': True}

>>> response.status_code
200
Posted by: Guest on October-08-2021
15

api in python

import requests
import json

r = requests.get("URL")
j=r.json()
print(j)
Posted by: Guest on February-19-2020

Python Answers by Framework

Browse Popular Code Answers by Language