When i call the Gitlab API, searching for a User named Edbtvplays i get this Error.

i have tried curling the API outside of python and i do not recieve this error

import requests

r = requests.post("https://git.deploys.io/api/v4/users?username=Edbtvplays", headers={"PRIVATE-TOKEN":"Removed Token"})

It should return [] as if no user was found or it should return a json with the Users information

1 Answers

VonC On

Check out what is returned: the GitLab Users API page does mention:

If an error occurs a 400 Bad Request is returned with a message explaining the error.

That, or it is a server-side issue, as in gitlab-com/support-forum issue 2720

The 400 errors were caused by a server side check that required a User-Agent header to be provided.
That's why only particular clients were affected.