Part 18 :PUT Method Example REST API JSONPLACEHOLDER using Python requests library
import requests
import json
urlpost='https://jsonplaceholder.typicode.com/...
bodypost={
'title': 'foo',
'body': 'bar',
'userId': 1
}
headerpost={'Content-type': 'application/json; charset=UTF-8'}
response=requests.post(url=urlpost,headers=headerpost,json=bodypost,)
status=response.status_code
print(status)
assert status==201
jsonObject=response.json()
print(jsonObject['id'])
print(jsonObject)
urlput='https://jsonplaceholder.typicode.com/...
responseput=requests.put(url=urlput,headers=headerpost,json=jsonObject,)
statusput=responseput.status_code
print(statusput)
print(responseput.json()['id'])
print(response.json())
On this page of the site you can watch the video online Part 18 :PUT Method Example REST API JSONPLACEHOLDER using Python requests library with a duration of hours minute second in good quality, which was uploaded by the user AppSmashers 18 June 2024, share the link with friends and acquaintances, this video has already been watched 532 times on youtube and it was liked by 3 viewers. Enjoy your viewing!