Class Browser::WebGet
In: webget.rb
Parent: Object

This class provides your program functions to access WWW documents via HTTP, Hyper Text Transfer Protocol nversion 1.1., providing authorisation mechanisms (base 64), proxy access and static cookies Note: Does not follow 302 redirects by default.

Methods

Constants

VERSION = '0.5'
AGENT_ALIASES = { 'Windows IE 7' => "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; SV1)" , 'Windows IE 6' => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", 'Linux Firefox 2' => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1", 'Webget' => "Browser-WebGet/#{VERSION} (http://www.securitytechscience.com/)"

Attributes

follow_302  [RW] 
http_req  [R] 
resp_body  [R] 
resp_header  [R] 
ssl_verify_mode  [RW] 
user_agent  [RW] 

Public Class methods

Create an instance of Webget

 scheme: 'http' or 'https' or 'ftp'
 host: ip or url address
 port: port number
 proxy_host: proxy ip/url address
 proxy_port: proxy port

Public Instance methods

Set basic authorisation credentials

Perform an HTTP GET request - Does not follow 301/302 redirects

 path: '/file.php?a=b'
 get_header: {'User-agent'=>Browswer::WebGet::WIN_IE_7}

Perform an HTTP POST request - Does not follow 301/302 redirects

 path: '/file.php?a=b'
 get_header: {'User-agent'=>Browswer::WebGet::WIN_IE_7}
 post_header: 'a=1&b=2'

Print the response body

Print the response header

Print the response header and body

Set proxy basic authorisation credentials

Set the user agent for the Webget object. See AGENT_ALIASES

[Validate]