HTTP Client Module

From BaseX Documentation
Revision as of 03:33, 17 December 2010 by CG (talk | contribs)
Jump to navigation Jump to search

The HTTP client module supports sending of HTTP requests and handling of HTTP responses. It defines just one function -send-request, preceded by thehttp:prefix, which is based on theEXPathspecification. As the module is currently under development, it does not support all features described in the specification. Here are listed only the ones currently supported and most probably the documentation will change over time.

http:send-request

Signatures http:send-request($request as element(http:request)) as item()+
http:send-request($request as element(http:request)?, $href as xs:string?) as item()+
Summary Sends an HTTP request and interprets the corresponding response.
Rules $requestcontains the parameters of the HTTP request like HTTP method and headers. In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method. If the URI is not given with the parameter$href, its value in$requestis used instead. The structures ofhttp:request,http:headerandhttp:bodyelements follow theEXPathspecification. The attributeauth-methodof$requestis not considered in our implementation because we are handling only basic authentication. Furthermore, currently if any serialization parameters are provided in thehttp:bodychild of$request, they are always considered, i.e. the case when thesrcattribute is set, is not handled. Sending of multipart HTTP requests and handling of responses with content different from XML, HTML and text is not supported.