Kong / unirest-ruby

Unirest in Ruby: Simplified, lightweight HTTP client library.
http://unirest.io/ruby
MIT License
364 stars 81 forks source link

Add base_url method #43

Open tit opened 8 years ago

tit commented 8 years ago

Please, add base_url method, a-la on Airborne.

Airborne ↓

Airborne.configure do |config|
  config.base_url = 'http://example.com/api/v1'
  config.headers = { 'x-auth-token' => 'my_token' }
end

Unirest ↓

Unirest.base_url = 'http://example.com/api'
# http://example.com/api/auth?user=foo&pass=bar
response = Unirest.get '/auth?user=foo&pass=bar'