Part 20: POST PUT DELETE Example Testing using REST API for httpbin.org with Python Requests lib

Опубликовано: 06 Август 2026
на канале: AppSmashers
596
1

Part 20: POST PUT DELETE Example Testing using REST API for httpbin.org with Python Requests lib

Example:
import requests
import json

urlpost='https://httpbin.org/delete'

headerpost={'Content-type': 'application/json'}
response=requests.delete(url=urlpost,headers=headerpost,)
status=response.status_code
print(status)
assert status==200
jsonObject=response.json()
print(jsonObject['headers']['User-Agent'])