Permalink
Browse files

Added documentation via example of how to send custom user agents

  • Loading branch information...
1 parent 8fe9fda commit d88eeff4858e650a08b293bc5cc0708809229b65 David Fisher committed Dec 23, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 examples/headers_and_user_agents.rb
@@ -0,0 +1,6 @@
+# To send custom user agents to identify your application to a web service (or mask as a specific browser for testing), send "User-Agent" as a hash to headers as shown below.
+
+require 'httparty'
+
+APPLICATION_NAME = "Httparty"
+response = HTTParty.get('http://example.com', :headers => {"User-Agent" => APPLICATION_NAME})

0 comments on commit d88eeff

Please sign in to comment.