|
|
|
|
|
by archiewood
969 days ago
|
|
My most common use case here is to then want to hit the API from python, and adjust the params / url etc. Would love a "copy to python requests" button that grabs the headers generates a boilerplate python snippet including the headers and the URL: import requests
import json
url = '<endpoint>'
headers = {
'User-Agent': 'Mozilla/5.0 ...',
...
}
data = {
"page": 5,
"size": 28
...
}
response = requests.post(url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
print(response.json())
else:
print(f"Error {response.status_code}: {response.text}")
|
|
- open the network console
- right click on the request
- click "copy as curl"
- visit https://curlconverter.com/ to convert to Python/Node/any language