Add headers to request
Execute request with method
Execute GET for http and retrieve file for FTP. You have to provide at least uri. All other arguments should conform to HTTPRequest.get or FTPRequest.get depending on the URI scheme. When arguments do not conform scheme (for example you try to call get("ftp://somehost.net/pub/README", {"a":"b"}) which doesn't make sense) you will receive Exception("Operation not supported for ftp")
Execute POST for http and STOR file for FTP. You have to provide uri and data. Data should conform to HTTPRequest.post or FTPRequest.post depending on the URI scheme. When arguments do not conform scheme you will receive Exception("Operation not supported for ftp")
Set authenticator for http requests. v - Auth instance.
Set local address for any outgoing requests. v can be string with hostname or ip address.
Set IO buffer size for http and ftp requests v - buffer size in bytes.
get contentLength of the responce
get length og actually received content. this value increase over time, while we receive data
Set Cookie for http requests. v - array of cookie.
Get Cookie for http requests.
Set http keepAlive value v - use keepalive requests - true, or not - false Request will automatically reopen connection when host, protocol or port change (so it is safe to send different requests through single instance of Request). It also recovers if server prematurely close keep-alive connection.
Set maximum content lenth both for http and ftp requests v - maximum content length in bytes. When limit reached - throws RequestException
Set maximum length for HTTP headers v - maximum length of the HTTP response. When limit reached - throws RequestException
Set limit on HTTP redirects v - limit on redirect depth Throws MaxRedirectsException when limit is reached.
set proxy property. v - full url to proxy.
Set path to ssl ca cert file.
Set path to ssl cert file.
Set path to ssl key file.
Enable or disable ssl peer verification. v - enable if true, disable if false.
Set timeout on connection and IO operation. v - timeout value If timeout expired Request operation will throw TimeoutException.
set "streaming" property v = value to set (true - use streaming).
Set verbosity for HTTP or FTP requests. v - verbosity level (0 - no output, 1 - headers to stdout, 2 - headers and data hexdump to stdout). default = 0.
This is simplest interface to both http and ftp protocols. Request has methods get, post and exec which routed to proper concrete handler (http or ftp, etc). To enable some protocol-specific featutes you have to use protocol interface directly (see docs for HTTPRequest or FTPRequest)