Returns a new HTTP stream request object
The HTTP method required (eg. OPTIONS)
The URL to which the stream will be sent
A table of additional HTTP headers
A function that will be executed when the transfer completes either successfully or because of an error
An httpstream object
This method creates an httpstream object that can be used to stream data to a specified server when the size of the content is not known ahead of time. The most common HTTP streaming request methods are provided by the imp API methods http.poststream() and http.putstream(), but you can use http.requeststream() if you need an HTTP method other than POST or PUT.
The returned httpstream object is primed to make a request of the type specified using the verb parameter, to the URL specified by the url parameter. The URL must start with
The headers passed as a table into headers can be any supported by HTTP.
The function passed into callback will be invoked with a single parameter, response, which references a table with the following keys:
|statuscode||Integer||HTTP status code (or libcurl error code)|
|headers||Table||Squirrel table of returned HTTP headers|
|body||String||Returned HTTP body (if any)|
For the possible values of statuscode, see httprequest.sendasync().
Note Once the callback has been invoked, the httpstream object is no longer valid, and any further calls to its methods will result in Squirrel errors.