add some documentation for request_cgi

git-svn-id: file:///home/svn/framework3/trunk@10293 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-09-11 17:31:26 +00:00
parent 12b15506c6
commit eddd6d481d
2 changed files with 26 additions and 2 deletions

View File

@ -221,6 +221,8 @@ module Exploit::Remote::HttpClient
#
# Connects to the server, creates a request, sends the request, reads the response
#
# Passes +opts+ through directly to Rex::Proto::Http::Client#request_raw.
#
def send_request_raw(opts={}, timeout = 20)
begin
c = connect(opts)
@ -239,6 +241,8 @@ module Exploit::Remote::HttpClient
#
# Connects to the server, creates a request, sends the request, reads the response
#
# Passes +opts+ through directly to Rex::Proto::Http::Client#request_cgi.
#
def send_request_cgi(opts={}, timeout = 20)
begin
c = connect(opts)

View File

@ -8,8 +8,9 @@ module Http
###
#
# Acts as a client to an HTTP server, sending requests and receiving
# responses.
# Acts as a client to an HTTP server, sending requests and receiving responses.
#
# See the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616.html
#
###
class Client
@ -172,6 +173,25 @@ class Client
#
# Create a CGI compatible request
#
# Options:
# - agent: User-Agent header value
# - basic_auth: Basic-Auth header value
# - connection: Connection header value
# - cookie: Cookie header value
# - ctype: Content-Type header value, default: +application/x-www-form-urlencoded+
# - data: HTTP data (only useful with some methods, see rfc2616)
# - encode: URI encode the supplied URI
# - headers: HTTP headers as a hash, e.g. <code>{ "X-MyHeader" => "value" }</code>
# - method: HTTP method to use in the request, not limited to standard methods defined by rfc2616, default: GET
# - proto: protocol, default: HTTP
# - query: raw query string
# - raw_headers: HTTP headers as a hash
# - uri: the URI to request
# - vars_get: GET variables as a hash to be translated into a query string
# - vars_post: POST variables as a hash to be translated into POST data
# - version: version of the protocol, default: 1.1
# - vhost: Host header value
#
def request_cgi(opts={})
c_enc = opts['encode'] || false
c_cgi = opts['uri'] || '/'