Loading TOC...

xdmp:http-head

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

Summary

Sends the http HEAD method to the specified URI. Returns the http response header for the specified URI.

Parameters
uri The URI of the document whose response header 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-head

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-head("http://www.my.com/document.xhtml",
     <options xmlns="xdmp:http">
       <authentication method="basic">
         <username>myname</username>
         <password>mypassword</password>
       </authentication>
     </options>)
=> the response header from the server

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