1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Add some docs/info for proxying.

This commit is contained in:
Brian Donovan 2008-09-02 20:36:54 -07:00
parent be13a8035f
commit 74e81c12b1
2 changed files with 22 additions and 0 deletions

14
README
View file

@ -85,6 +85,20 @@ Either produces logs like this:
Note that these logs are valid Ruby, so you can paste them into the restclient
shell or a script to replay your sequence of rest calls.
== Proxy
All calls to RestClient, including Resources, will use the proxy specified by
RestClient.proxy:
RestClient.proxy = "http://proxy.example.com/"
RestClient.get "http://some/resource"
# => response from some/resource as proxied through proxy.example.com
Often the proxy url is set in an environment variable, so you can do this to
use whatever proxy the system is configured to use:
RestClient.proxy = ENV['http_proxy']
== Meta
Written by Adam Wiggins (adam at heroku dot com)

View file

@ -29,6 +29,14 @@ require File.dirname(__FILE__) + '/request_errors'
# # DELETE
# RestClient.delete 'http://example.com/resource'
#
# To use with a proxy, just set RestClient.proxy to the proper http proxy:
#
# RestClient.proxy = "http://proxy.example.com/"
#
# Or inherit the proxy from the environment:
#
# RestClient.proxy = ENV['http_proxy']
#
# For live tests of RestClient, try using http://rest-test.heroku.com, which echoes back information about the rest call:
#
# >> RestClient.put 'http://rest-test.heroku.com/resource', :foo => 'baz'