DESCRIPTION
HTTPClient -- Client to retrieve web resources via HTTP.
How to create your client.
1. Create simple client. clnt = HTTPClient.new 2. Accessing resources through HTTP proxy. clnt = HTTPClient.new("http://myproxy:8080") 3. Set User-Agent and From in HTTP request header.(nil means "No proxy") clnt = HTTPClient.new(nil, "MyAgent", "nahi@keynauts.com")
How to retrieve web resources.
1. Get content of specified URL. puts clnt.get_content("http://www.ruby-lang.org/en/") 2. Do HEAD request. res = clnt.head(uri) 3. Do GET request with query. res = clnt.get(uri) 4. Do POST request. res = clnt.post(uri) res = clnt.get|post|head(uri, proxy)
| Constants | |
|---|---|
| RCS_ |
|
| RUBY_ |
|
| SSLEnabled | |
| VERSION | |
<code/>and<pre/>for code samples.