net/
mgnetrequest__define.pro
includes main-level programClass 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
Other file information
- Todo:
Things to do:
* handle HTTPS requests besides GET, PUT, and POST * handle proxies * write some tests
Class description for mgnetrequest
Properties
Properties in mgnetrequest
- debug get set init type=boolean
set to print debugging messages to standard output
- url init
Routines
Routines from mgnetrequest__define.pro
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 mgnetrequest::_printf
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 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 mgnetrequest::_initializeHeaders
mgnetrequest::_initializeHeaders
Add some default headers that are always present (but can be changed).
top 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 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 mgnetrequest::get
result = mgnetrequest::get( [response_header=strarr])
Send a GET request.
Keywords
- response_header out optional type=strarr
header of the response
top mgnetrequest::head
result = mgnetrequest::head( [response_header=strarr])
Send a HEAD request.
Keywords
- response_header out optional type=strarr
header of the response
top 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 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 mgnetrequest::delete
result = mgnetrequest::delete( [response_header=strarr])
Send a DELETE request.
Keywords
- response_header out optional type=strarr
header of the response
top mgnetrequest::options
result = mgnetrequest::options( [response_header=strarr])
Send a OPTIONS request.
Keywords
- response_header out optional type=strarr
header of the response
top mgnetrequest::trace
result = mgnetrequest::trace( [response_header=strarr])
Send a TRACE request.
Keywords
- response_header out optional type=strarr
header of the response
top mgnetrequest::connect
result = mgnetrequest::connect( [response_header=strarr])
Send a CONNECT request.
Keywords
- response_header out optional type=strarr
header of the response
top 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 mgnetrequest::getProperty
mgnetrequest::getProperty, /debug
Get property values.
Keywords
- debug type=boolean
set to print debugging messages to standard output
top mgnetrequest::setProperty
mgnetrequest::setProperty, /debug
Set property values.
Keywords
- debug type=boolean
set to print debugging messages to standard output
top 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
File attributes
Modification date: | Wed May 14 15:07:14 2014 |
Lines: | 239 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.