<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.httpOptions.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.httpOptions</api:function-name><api:suggest>xdmp.httpoptions</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>httpoptions</api:suggest><api:function-link mode="xquery" fullname="xdmp:http-options">/apidoc/8.0/xdmp:http-options.xml</api:function-link><api:function mode="javascript" name="httpOptions" type="builtin" lib="xdmp" category="Extension" subcategory="HTTP" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.httpOptions"><api:summary>
  Sends the http OPTIONS method to the specified URI. Returns the http response
  for the specified URI.
</api:summary><api:params><api:param name="uri" type="xs:string" optional="false"><api:param-description>
   The URI of the document whose options response is being requested.
  </api:param-description><api:param-name>uri</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="options" type="(element()|map:map)?" optional="true"><api:param-description>
    
    <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">The options object for this request. The
    default value is null.
    The options are the same as the other <code>xdmp.http*</code>
    functions, and the options are documented with the
    <a href="./xdmp.httpGet"><code>xdmp.httpGet</code></a> $options
    parameter.</span>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>Object?</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
   <p xmlns="http://www.w3.org/1999/xhtml">The http functions only operate on URIs that use the http or https
   schemes; specifying a URI that does not begin with <code>http://</code>
   or <code>https://</code> throws an exception.</p>
   <p xmlns="http://www.w3.org/1999/xhtml">If an http function times out, it throws a socket received
   exception (SVC-SOCRECV).</p>
</api:usage><api:privilege>
   <code xmlns="http://www.w3.org/1999/xhtml">http://marklogic.com/xdmp/privileges/xdmp-http-options</code>
</api:privilege><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.httpOptions("http://localhost:8000/",
     {
       "authentication" : {
         "method" : "digest",
         "username" : "myname",
         "password" : "mypassword"
       }
     })
=&gt; the response from the HTTP server, for example:

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



</pre></api:example></api:function></api:function-page>