301 redirect error with REST API v3

I send a GET request to

[https://api.github.com/repos/aplteam/meddy/releases/latest](https://api.github.com/repos/aplteam/meddy/releases/latest)

with  'Accepted: ‘application/vnd.github.v3+json’

and get a 301.

The “Location” field in the header reads

[https://github.com/repos/aplteam/meddy/releases/latest](https://github.com/repos/aplteam/meddy/releases/latest)

When I use this I get a 404. 

I am lost…

1 Like

Obviously I am doing something wrong because when I tried the same (apparently) with .NET it worked.

However, doing something wrong should certainly not result in a 301 that points into nowhere land.

1 Like

Not sure if this was just a typo you made while typing up this post, but you seem to be using _Accepted _instead of Accept in your headers. This can in return throw an error and cause you to receive numerous HTTP error codes.

Hope this fixes your problem! If it persists, please reply back to my message and we’ll see what we can come up with next!

This was a typo in the post.

However, I found the cause of the problem. Of course it was me: I’d specified “github.com” in the HTTP “Host” header field rather than the correct “api.github.com”.

That Github answers this with a 301 that contains an invalid “Location” header is another matter.

Thanks.

1 Like