Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the user agent for Ruby's RestClient?

I'm interested in setting my own user agent when using the ruby RestClient gem.

http://github.com/archiloque/rest-client

However, I can't find any documentation on how to do so. Any pointers?

like image 515
Han Avatar asked Aug 10 '12 10:08

Han


1 Answers

RestClient.get 'http://localhost', :user_agent => "myagent"

See https://github.com/rest-client/rest-client/blob/master/lib/restclient.rb

like image 157
systemfreund Avatar answered Oct 16 '22 04:10

systemfreund