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 “” _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)

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!

1 Like

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

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!

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

1 Like