Loading TOC...

xdmp:http-delete

xdmp:http-delete(
   $uri as xs:string,
   [$options as (element()|map:map)?]
) as item()+

Summary

Sends an http DELETE request to the http server specified in the URI to delete the specified resource. The server should respond if the request is to be completed, but a response is not guaranteed. Also, even if the server does respond, it does not guarantee that the request has been or will be completed.

Parameters
uri The URI of the document to delete.
options The options node for this request. The default value is (). The node for the xdmp:http-delete options must be in the xdmp:http namespace. The options are the same as the other xdmp:http-* functions, and the options are documented with the xdmp:http-get $options parameter.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-http-delete

Usage Notes

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).

Note the xdmp:http-delete function simply sends a DELETE request to the specified web server; what happens with the DELETE request depends on the web server. The request does not delete a document from a MarkLogic Server database. To delete a document from a database, use the xdmp:document-delete function.

Example

xdmp:http-delete("http://www.my.com/document.xhtml",
     <options xmlns="xdmp:http">
       <authentication method="basic">
         <username>myname</username>
         <password>mypassword</password>
       </authentication>
     </options>)
=> an optional response from the server


Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.