Viewed 4 times

I am trying to authenticate a user by GitHub API. I've tried on two methods, Authentication via username and password and via personal access token(PAT) like this;

curl -u devmania1223 https://api.github.com/user   /*via username and password*/

curl -u ghp_I60uniHdf6UKDCkyde1InP7kwRwsw2fD0wx https://api.github.com/user   /*via personal access token*/

Inputted username and password, PAT correctly, but the response is not right.

{
  "message": "Requires authentication",
  "documentation_url": "https://docs.github.com/rest/reference/users#get-the-authenticated-user"
}

So, What's wrong with curl command?

Similar Questions