1 Introduction
1.1 Namespace conventions
1.2 Error management
2 The http:send-request function
3 Sending a request
3.1 The request elements
3.2 Serializing the request content
3.3 Authentication
4 Dealing with the response
4.1 The result element
4.2 Representing the result content
http:send-request
functionhttp:send-request
($uri asxs:string?
, $content asitem()?
, $request aselement(http:request)?
, $serial asitem()?
) asitem()+
$serial
defines the serialization option to serialize the content to
the HTTP request. It can be either a serialization method (a string,
either 'xml', 'html', 'xhtml' or 'text') or an xsl:output element.
The content is then serialized accordingly to the choosen method or
xsl:output regarding [XSLT and XQuery Serialization].
method
is the HTTP verb to use, as GET, POST, etc. It is case
insensitive
href
is the URI the request has to be sent to. It can be overriden
by the parameter $uri
http:multipart
represents a multi-part body, either in a request
or a response, as defined below.
The http:header
element represents an HTTP header, either in a request
or in a response.
If content-type
is not an XML media type, the string value of the
http:body
element is used. If this is an XML media type, it is
serialized using the parameter $serial
. This parameter can be an
xsl:output
element, as defined in [XSLT 2.0], and the
serialization is defined in [XSLT and XQuery Serialization]. $serial
can
also be a string, either 'xml
', 'html
', 'xhtml
'
or 'text
' (other values are implementation-defined, as explained in
the above mentioned recommendations.) (TODO: $serial
could be a function
item too, when EXSLT will have defined the corresponding module.) The default
value for this parameter depends on the content-type
of the body
('xml', 'html' and 'xhtml' are the default for corresponding media types, and
'text' for other media types.)
The attribute auth-method
can be either "Basic
" or
"Digest
", but other values can also be used, in an
implementation-defined way. The handling of those attributes must be done
in conformance to [RFC 2617]. If send-authorization
is true (default value is false) and the authentication method supports
generating the header Authorization
without challenge, the
request contains this header. The default value is to send a non-authenticated
request, and if the response is an authentication challenge, then only send
the credentials in a second message.