Loading TOC...

xdmp:http-options

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

Summary

Sends the http OPTIONS method to the specified URI. Returns the http response for the specified URI.

Parameters
uri The URI of the document whose options response is being requested.
options Options with which to customize this operation. You can specify options as either an XML element in the "xdmp:http" namespace, or as a map:map. For details on the supported options, see xdmp:http-get.

Required Privileges

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

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

Example

xdmp:http-options("http://localhost:8000/",
     <options xmlns="xdmp:http">
       <authentication method="digest">
         <username>myname</username>
         <password>mypassword</password>
       </authentication>
     </options>)
=> the response from the HTTP server, for example:

<response xmlns="xdmp:http">
  <code>302</code>
  <message>Found</message>
  <headers>
    <location>/use-cases/</location>
    <server>MarkLogic</server>
    <content-length>0</content-length>
    <connection>close</connection>
  </headers>
</response>



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