Sha256: 480a67cf83dc7bdb0b07b775b3b8d96b5e51cdeb732002f5271bcc092a3eb493

Contents?: true

Size: 320 Bytes

Versions: 16

Compression:

Stored size: 320 Bytes

Contents

# 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})

Version data entries

16 entries across 15 versions & 5 rubygems

Version Path
alloy_sdk-0.1.0 vendor/bundle/ruby/3.0.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
alloy_sdk-0.1.0 vendor/bundle/ruby/2.6.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.9 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.8 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.7 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.6 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.5 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.4 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.3 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.2 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
allegro_api_client-0.0.1 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/headers_and_user_agents.rb
httparty-0.13.1 examples/headers_and_user_agents.rb
yoyle439587298-0.13.0 examples/headers_and_user_agents.rb
httparty-0.13.0 examples/headers_and_user_agents.rb
httparty-0.12.0 examples/headers_and_user_agents.rb