Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 5

GitHub Request Headers

Just a heads up I'm a complete noob to this so I assume my problem isn't anything too complex. I'm attempting to make a request to the github api with this url "https://api.github.com/users/your_username" literall thats it. It works on cURL but when I try to do it using a sharepoint workflow I get returned the status of "401 Unauthorized" and the response content says "bad credentials" even though you shouldn't need any credentials to make that call. My guess is that in cURL it automatically sends request headers that github accepts but in sharepoint workflow its not sending any request headers.

 

So first question: do you think thats the correct assumption? that sharepoint isn't sending any request headers to the github api?

 

Second question: If that is the problem, what are the required headers that I must include to make a request to the github API?

 

Also I know that User-Agent is required but even when I include that in the request headers it doesn't work (I include the user-agent of "JimmyShimmy" because that is my username)

4 Replies
Highlighted
Community Manager
Message 2 of 5

Re: GitHub Request Headers

Request headers are a fair assumption. You should be able to use `curl --verbose` to display the request headers it sends and duplicate those to test your theory.

 

I hope that helps!

Copilot Lvl 3
Message 3 of 5

Re: GitHub Request Headers

I tried that and was still getting an error. The only way i got it to work was by passing in an Authorization token, even though it should be a public resource. My guess is sharepoint is automatically including some invalid authorization header and by manually putting in a request header for authorization it overrides the other one. Thats just my guess though

Community Manager
Message 4 of 5

Re: GitHub Request Headers

It's been a long time since I've done anything relating to SharePoint, so I wouldn't be of much use there. But it sounds like you have something that's working now.

 

Let us know if you have more questions!

Copilot Lvl 3
Message 5 of 5

Re: GitHub Request Headers

The best solution I could find was to pass in "Authorization: basic" as a header. github seems to accept that so this way you don't need a token to access public resources