api: TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
Opened this issue · 0 comments
WDragon101 commented
I ran into the following problem when I tried the API:
TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
When I call the API using python, the result is unexpected even though the access is normal, this is my code: ` import requests import jsonbase_url = "https://api.globalpollenproject.org"
def backbone():
url = base_url + "/api/v1/backbone/search/"
data = {
"latinName": "Oryza",
"rank": "Genus"
}
headers = {"content-type": "application/json-patch+json"}
res = requests.get(url=url, data=json.dumps(data), headers=headers)
print(res.status_code)
print(res.text)
if name == "main":
backbone()`