GitHub API : User Agent Now Mandatory

GitHub now enforces the User Agent. If you do API calls without user agent you will get a 403 error message back. Check out this post: http://developer.github.com/changes/2013-04-24-user-agent-required/.

If you are using the HTTParty GEM in Ruby to do the API calls you have to set the headers. Here an example:

body = HTTParty.get(url, :headers => {"User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17" } ).response.body

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s