idllib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

net/

mgnetrequest__define.pro

includes main-level program

Class representing a URI request: GET, PUT, POST, DELETE, HEAD, OPTIONS, TRACE, and CONNECT.

Examples

For example:

b = obj_new('MGnetRequest', 'brightkite.com/people/mgalloy.xml') b->setProperty, debug=1 r = b->get(response_header=h) obj_destroy, b

Class description for mgnetrequest

Properties

debug get set init type=boolean

set to print debugging messages to standard output

url init

Other file information

Todo:

Things to do:

* handle HTTPS requests besides GET, PUT, and POST * handle proxies * write some tests

Routines

mgnetrequest::_printf, lun, s

Sends its output to the given socket LUN and, if self.debug is set, to standard output.

mgnetrequest::_sendHeaders, lun

Send the headers in the headers hash table to the given LUN.

mgnetrequest::_sendHeadersNetUrl, netUrl
mgnetrequest::_initializeHeaders

Add some default headers that are always present (but can be changed).

result = mgnetrequest::_sendNetUrl(method [, data] [, response_header=strarr])

Connect via IDLnetURL instead of SOCKET.

result = mgnetrequest::_send(method [, data] [, response_header=strarr])

General method for sending a request.

result = mgnetrequest::get( [response_header=strarr])

Send a GET request.

result = mgnetrequest::head( [response_header=strarr])

Send a HEAD request.

result = mgnetrequest::put(data [, response_header=strarr])

Send a PUT request.

result = mgnetrequest::post(data [, response_header=strarr])

Send a POST request.

result = mgnetrequest::delete( [response_header=strarr])

Send a DELETE request.

result = mgnetrequest::options( [response_header=strarr])

Send a OPTIONS request.

result = mgnetrequest::trace( [response_header=strarr])

Send a TRACE request.

result = mgnetrequest::connect( [response_header=strarr])

Send a CONNECT request.

mgnetrequest::addHeader, key, value

Add a header field to the request.

mgnetrequest::getProperty, /debug

Get property values.

mgnetrequest::setProperty, /debug

Set property values.

mgnetrequest::cleanup

Free resources.

result = mgnetrequest::init( [url_param] [, url=string], /debug)

Create a request object.

mgnetrequest__define

Define instance variables.

Routine details

top source mgnetrequest::_printf

mgnetrequest::_printf, lun, s

Sends its output to the given socket LUN and, if self.debug is set, to standard output.

Parameters

lun in required type=long

logical unit number of the socket connection to send the output to

s in required type=any

variable to be printed

top source mgnetrequest::_sendHeaders

mgnetrequest::_sendHeaders, lun

Send the headers in the headers hash table to the given LUN.

Parameters

lun in required type=long

logical unit number of the socket/file to send the headers to

top source mgnetrequest::_sendHeadersNetUrl

mgnetrequest::_sendHeadersNetUrl, netUrl

Parameters

netUrl

top source mgnetrequest::_initializeHeaders

mgnetrequest::_initializeHeaders

Add some default headers that are always present (but can be changed).

top source mgnetrequest::_sendNetUrl

result = mgnetrequest::_sendNetUrl(method [, data] [, response_header=strarr])

Connect via IDLnetURL instead of SOCKET.

Return value

strarr representing the body of the response to the request

Parameters

method in required type=string

method to use to send the request: GET, PUT, POST, HEAD, DELETE, OPTIONS, TRACE, or CONNECT

data in optional type=any

data to send in PUT and POST methods

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::_send

result = mgnetrequest::_send(method [, data] [, response_header=strarr])

General method for sending a request.

Return value

strarr representing the body of the response to the request

Parameters

method in required type=string

method to use to send the request: GET, PUT, POST, HEAD, DELETE, OPTIONS, TRACE, or CONNECT

data in optional type=any

data to send in PUT and POST methods

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::get

result = mgnetrequest::get( [response_header=strarr])

Send a GET request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::head

result = mgnetrequest::head( [response_header=strarr])

Send a HEAD request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::put

result = mgnetrequest::put(data [, response_header=strarr])

Send a PUT request.

Parameters

data

Keywords

response_header out optional type=strarr

header of the response

Other attributes

Todo:

add content body of request

top source mgnetrequest::post

result = mgnetrequest::post(data [, response_header=strarr])

Send a POST request.

Parameters

data in required type=any

data to be transferred

Keywords

response_header out optional type=strarr

header of the response

Other attributes

Todo:

add content body of request

top source mgnetrequest::delete

result = mgnetrequest::delete( [response_header=strarr])

Send a DELETE request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::options

result = mgnetrequest::options( [response_header=strarr])

Send a OPTIONS request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::trace

result = mgnetrequest::trace( [response_header=strarr])

Send a TRACE request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::connect

result = mgnetrequest::connect( [response_header=strarr])

Send a CONNECT request.

Keywords

response_header out optional type=strarr

header of the response

top source mgnetrequest::addHeader

mgnetrequest::addHeader, key, value

Add a header field to the request. If the header already exists in the request, then it is replaced by the next value.

Parameters

key in required type=string

header field name

value in required type=string

header field value

top source mgnetrequest::getProperty

mgnetrequest::getProperty, /debug

Get property values.

Keywords

debug type=boolean

set to print debugging messages to standard output

top source mgnetrequest::setProperty

mgnetrequest::setProperty, /debug

Set property values.

Keywords

debug type=boolean

set to print debugging messages to standard output

top source mgnetrequest::cleanup

mgnetrequest::cleanup

Free resources.

top source mgnetrequest::init

result = mgnetrequest::init( [url_param] [, url=string], /debug)

Create a request object.

Parameters

url_param in optional type=string

URL to send request to; either url_param parameter or URL keyword must be set to the URL to send the request to

Keywords

url in optional type=string

URL to send request to; either url_param parameter or URL keyword must be set to the URL to send the request to

debug type=boolean

set to print debugging messages to standard output

top source mgnetrequest__define

mgnetrequest__define

Define instance variables.

File attributes

Modification date: Mon Nov 29 18:32:23 2010
Lines: 559
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.