<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.httpPut.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.httpPut</api:function-name><api:suggest>xdmp.httpput</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>httpput</api:suggest><api:function-link mode="xquery" fullname="xdmp:http-put">/apidoc/8.0/xdmp:http-put.xml</api:function-link><api:function mode="javascript" name="httpPut" type="builtin" lib="xdmp" category="Extension" subcategory="HTTP" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.httpPut"><api:summary>
  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.
</api:summary><api:params><api:param name="uri" type="xs:string" optional="false"><api:param-description>
    The URI to which the data is to be put.
  </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.</span>
    
    <p class="javascript" xmlns="http://www.w3.org/1999/xhtml">The options include
    the following option, in addition to the options documented with the
    <a href="./xdmp.httpGet"><code>xdmp.httpGet</code></a> $options
    parameter:</p>
    <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
    
    <dt class="javascript"><p>data</p></dt>
    <dd>This option can contain any string. Anything in the <code>data</code>
    option is sent as a string in the PUT body. If binary is to be sent,
    it can be specified as the optional third argument instead.</dd>
    <dt><p>The other options are the same as the other
    <code class="javascript">xdmp.http*</code>
    functions, and the options are documented with the
    
    <a class="javascript" href="./xdmp.httpGet"><code>xdmp.httpGet</code></a>
    $options parameter.</p></dt>
    </dl>
    </blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>Object?</api:param-type></api:param><api:param name="data" type="node()?" optional="true"><api:param-description>
    The data for this request. This is an alternative to the
    <code xmlns="http://www.w3.org/1999/xhtml">data</code> option for the second parameter that allows binary
    content to be specified for the body of the PUT.
  </api:param-description><api:param-name>data</api:param-name><api:param-type>Node?</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>
   <p xmlns="http://www.w3.org/1999/xhtml">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.</p>
</api:usage><api:privilege>
   <code xmlns="http://www.w3.org/1999/xhtml">http://marklogic.com/xdmp/privileges/xdmp-http-put</code>
</api:privilege><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.httpPut("http://www.my.com/document.xhtml",
     {
       "authentication" : {
         "method" : "basic",
         "username" : "myname",
         "password" : "mypassword"
       }
     });
=&gt; the response from the HTTP server as well as the specified document


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