<doc>
	<legacy_id>1853</legacy_id>
	<name>libURLSetCustomHTTPHeaders</name>
	<type>command</type>

	<syntax>
		<example>libURLSetCustomHTTPHeaders <i>headersList</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Sets the headers to be sent with each request to an <keyword tag="http">HTTP</keyword> <glossary tag="server">server</glossary>.</summary>

	<examples>
<example>libURLSetCustomHTTPHeaders &quot;GET /catsdata/coldat.dat HTTP/1.1&quot;</example>
<example>libURLSetCustomHTTPHeaders field &quot;Headers&quot;</example>
	</examples>

	<history>
		<introduced version="1.1.1">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
	</classes>

	<security>
		<network/>
	</security>


	<classification>
		<category>Networks &amp; Communication</category>
		<category>Standalone Applications</category>
	</classification>

	<references>
		<function tag="libURLLastHTTPHeaders">libURLLastHTTPHeaders Function</function>
		<command tag="post">post Command</command>
		<keyword tag="http">http Keyword</keyword>
		<keyword tag="https">https Keyword</keyword>
	</references>

	<description>
	<overview>Use the <b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary> to implement an <keyword tag="http">HTTP</keyword> method other than GET, POST, DELETE, or PUT.</overview>

	<parameters>
  <parameter>The <i>headersList</i> is a <keyword tag="string">string</keyword>, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</parameter>
  </parameters>

	<value></value>
	<comments>Whenever LiveCode contacts a web server (with the <b>load</b> <glossary tag="command">command</glossary>, the <command tag="post">post</command> command, or by using an <keyword tag="http">HTTP</keyword> <keyword tag="URL">URL</keyword> in an <glossary tag="expression">expression</glossary>), the <i>headersList</i> is sent to the <glossary tag="web server">web server</glossary>.<p></p><p>Usually, the <i>headersList</i> will include multiple lines. A typical <i>headersList</i> might look like the following example:</p><p></p><p><code tag="">&#9;GET /catsdata/coldat.dat HTTP/1.1</code></p><p><code tag="">&#9;Connection: Close</code></p><p><code tag="">&#9;User-Agent: My Fancy Browser</code></p><p><code tag="">&#9;Host: www.cats-training.com</code></p><p><code tag="">&#9;Accept: image/gif, image/x-xbitmap, image/jpeg, image/png, */*</code></p><p><code tag="">&#9;Accept-Encoding: gzip</code></p><p><code tag="">&#9;Accept-Charset: iso-8859-1,*,utf-8</code></p><p></p><p>The <b>libURLSetCustomHTTPHeaders</b> setting takes effect for the next <keyword tag="http">HTTP</keyword> transaction. After the transaction, the headers are set back to the <keyword tag="default">default</keyword>. This means that if you want to do multiple <keyword tag="http">HTTP</keyword> transactions using the same set of custom headers, you must use the <b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary> before each transaction.</p><p></p><p>The <b>libURLSetCustomHTTPHeaders</b> setting replaces the <glossary tag="Internet library">Internet library's</glossary> <keyword tag="default">default</keyword> headers. To add to the <keyword tag="default">default</keyword> headers instead of replacing them, use the <property tag="httpHeaders">httpHeaders</property> <glossary tag="property">property</glossary> instead.</p><p></p><p>If you specify a set of headers using the <b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary>, the <glossary tag="Internet library">Internet library's</glossary> <keyword tag="default">default</keyword> headers and the setting of the <property tag="httpHeaders">httpHeaders</property> property are ignored, and the headers set by <command tag="libURLSetCustomHTTPHeaders">libURLSetCustomHTTPHeaders</command> are used instead.</p><p></p><p><code tag=""><important></code><code tag=""> The </code><b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary> is part of the <glossary tag="Internet library">Internet library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure &quot;Internet Library&quot; is selected in the list of script libraries.</important><p></p><p><code tag=""><note></code><code tag=""> When included in a</code> <glossary tag="standalone application">standalone application</glossary>, the <glossary tag="Internet library">Internet library</glossary> is implemented as a hidden <command tag="group">group</command> and made available when the <command tag="group">group</command> receives its first <message tag="openBackground">openBackground</message> message. During the first part of the <glossary tag="application">application's</glossary> startup process, before this <keyword tag="message box">message</keyword> is sent, the <b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary> is not yet available. This may affect attempts to use this <glossary tag="command">command</glossary> in <message tag="startup">startup</message>, <message tag="preOpenStack">preOpenStack</message>, <message tag="openStack">openStack</message>, or <message tag="preOpenCard">preOpenCard</message> <glossary tag="handler">handlers</glossary> in the <glossary tag="main stack">main stack</glossary>. Once the <glossary tag="application">application</glossary> has finished starting up, the <command tag="start using">library</command> is available and the <b>libURLSetCustomHTTPHeaders</b> <glossary tag="command">command</glossary> can be used in any <glossary tag="handler">handler</glossary>.</note><p></p><p>For technical information about the standard headers recognized in the HTTP 1.1 protocol, see RFC 2616 at &lt;<u>http://www.ietf.org/rfc/rfc2616.txt</u>&gt;.</p></comments>
	</description>
</doc>