Class

HTTPClient

Extends:

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_REVISION
RUBY_VERSION_STRING
SSLEnabled
VERSION
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.