I'm getting the following error and I'm not sure why:
{"success":false,"errors":["Missing or invalid POST body."],"results":[]}
I'm not sure if there is a problem with how I have my code structured, sending bad json, or what. If you could give me an idea of where to troubleshoot this, that would be great. Thanks. Here is how I have my settings:
headers = {
"Accept": "application/json",
"Authorization": "bearer " + bearer_token,
"Content-Type": "application/json",
}
data = {
'limit':10,
'sort':"MinPrice DESC",
'filters':[
{
'name':'SetName',
'values':'All'
}
]
}
url = 'http://api.tcgplayer.com/V1.9.0/catalog/categories/3/search'
def catalog_data():
r = requests.post(url, headers=headers, data=data)
print(r.text)
catalog_data()
Making the change from data=data to json=data allowed my Post data to be read properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With