GitXplorerGitXplorer
c

ruby-http-client

public
8 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
4eab557cbe9caf334cce66f631af2db91e37460b

Using SimpleDelegator...

cchristianhellsten committed 12 years ago
Unverified
b8c5e5ad9b77678f3bd3f402a056807af2ff199c

...

cchristianhellsten committed 12 years ago
Unverified
a475cc4a150f47c937680e53625c6a93db2efdc0

cleanup...

cchristianhellsten committed 12 years ago
Unverified
0aea7cce9bb02d139e26a28475ffbbee43969bca

Verify SSL enabled...

cchristianhellsten committed 12 years ago
Unverified
a04490ef109094882eea88fc77495e343e468484

Ruby 1.9 changes. Examples added.

cchristianhellsten committed 12 years ago
Unverified
c9183f57bd1acdc7a7e8ccb160208690ba4e7ba6

Bug fixes

cchristianhellsten committed 14 years ago

README

The README file for this repository.

h1. Introduction

A simple Net::HTTP based HTTP client that supports:

  • POST/GET
  • SSL/HTTPs
  • proxies
  • debugging
  • redirect handling
  • headers
  • connect and read timeout
  • detection of response encoding

h2. Usage

  
headers = {
  "User-Agent" => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13",
  "Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
# GET
response = HTTP.get(url, :headers => headers)

# POST
response = HTTP.post(url, :parameters => {:a => :b}, :headers => headers)

# Detect encoding
encoding = HTTP.encoding(response)

# Redirected where?
response = HTTP.get(url)
response.redirected_to

# Set proxy ignore
puts HTTP::PROXY_IGNORE
>> ['127.0.0.1', 'localhost']
HTTP::PROXY_IGNORE = ['google.com']