Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body. #67

Open
WDragon101 opened this issue Aug 21, 2023 · 0 comments

Comments

@WDragon101
Copy link

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 json

base_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()`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant