Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error 404: Not Found #14

Open
winterDroid opened this issue Dec 17, 2015 · 6 comments
Open

HTTP Error 404: Not Found #14

winterDroid opened this issue Dec 17, 2015 · 6 comments

Comments

@winterDroid
Copy link

When I try to use this script, I get all the time an HTTP Error 404: Not Found error when I try to get the access token with my github token. Do you have an idea why?

@winterDroid
Copy link
Author

Seems to be the same like #2

@winterDroid
Copy link
Author

It seems that travis now requires a 'user-agent' and 'accept' header - see https://docs.travis-ci.com/api#making-requests

@dleve123
Copy link

dleve123 commented Jan 6, 2016

I recently started getting this as well. @winterDroid Did you solve this by providing those headers in the request made from the script?

@winterDroid
Copy link
Author

@dleve123 Yes I solved this by providing a user agent. But you need to contact the travis support before so that they can whitelist your user agent.

@dleve123
Copy link

dleve123 commented Jan 7, 2016

@winterDroid Wonderful, thanks for the info. Of course that's not included in the docs:

Always set the User-Agent header. This header is not required right now, but will be in the near future. Assuming your client is called “My Client”, and it’s current version is 1.0.0, a good value would be MyClient/1.0.0. For our command line client running on OS X 10.9 on Ruby 2.1.1, it might look like this: Travis/1.6.8 (Mac OS X 10.9.2 like Darwin; Ruby 2.1.1; RubyGems 2.0.14) Faraday/0.8.9 Typhoeus/0.6.7.

Were you able to add the proper User-Agent and Accept headers with the following (after contacting Travis support)?

opener = urllib2.build_opener();
opener.addheaders = [('User-agent', '#{my_user_agent}/1.0.0'), ('Accept', 'application/vnd.travis-ci.2+json')]
opener.open(url).read()

Python isn't my forté, so just doubling checking that I'm not missing something!

Thanks!

@dleve123
Copy link

Update:

Setting the Accept and User-Agent headers didn't solve this issue for me. Switching from URL based token auth to header based auth (the Authorization header) did though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants