xdmp:http-put( $uri as xs:string, [$options as (element()|map:map)?], [$data as node()?] ) as item()+
Sends an HTTP PUT request to an HTTP server. The HTTP server should return a response, which will differ depending on the action the HTTP server takes for the PUT.
Parameters | |
---|---|
uri | The URI to which the data is to be put. |
options |
The options node for this request. The default value is ().
The node for the xdmp:http-put options must be in the
xdmp:http namespace.
The options include
the following option (in the
|
data |
The data for this request. This is an alternative to the
data option for the second parameter that allows binary
content to be specified for the body of the PUT.
|
http://marklogic.com/xdmp/privileges/xdmp-http-put
The http functions only operate on URIs that use the http or https
schemes; specifying a URI that does not begin with http://
or https://
throws an exception.
If an http function times out, it throws a socket received exception (SVC-SOCRECV).
If you expect the request body from this http function to be processed by another application (via a web service, for example), you should specify a content-type header. If no content-type header is specified, the content type defaults to text/plain.
xdmp:http-put("http://www.my.com/document.xhtml", <options xmlns="xdmp:http"> <authentication method="basic"> <username>myname</username> <password>mypassword</password> </authentication> </options>) => the response from the HTTP server as well as the specified document
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.