would someone be able to convert this curl?
curl -X POST "https://api2.isbndb.com/books" -H "accept: application/json" -H "Authorization: special access key" -H "Content-Type: application/json" -d "isbns=9781492666868,9781616555719"
I did so like this:
import requests
headers = {
'accept': 'application/json',
'Authorization': 'special access key',
'Content-Type': 'application/json',
}
data = {
'isbns': '9781492666868,9781616555719'
}
response = requests.post('https://api2.isbndb.com/books', headers=headers, data=data)
The results that i get from this are below:
print(response.json())
{'total': 0, 'requested': 1, 'data': []}
I do get the book data results I am looking for when I change my data dict to:
data = {
'isbns': '9781492666868'
}
So, I am little confused on how to approach this. Any thoughts are appreciated.
question from:
https://stackoverflow.com/questions/65928454/convert-curl-request 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…