<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dev.playonset.com/index.php?action=history&amp;feed=atom&amp;title=http_set_host</id>
	<title>http set host - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dev.playonset.com/index.php?action=history&amp;feed=atom&amp;title=http_set_host"/>
	<link rel="alternate" type="text/html" href="https://dev.playonset.com/index.php?title=http_set_host&amp;action=history"/>
	<updated>2026-04-24T10:18:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://dev.playonset.com/index.php?title=http_set_host&amp;diff=3753&amp;oldid=prev</id>
		<title>REDRUM at 22:24, 24 January 2020</title>
		<link rel="alternate" type="text/html" href="https://dev.playonset.com/index.php?title=http_set_host&amp;diff=3753&amp;oldid=prev"/>
		<updated>2020-01-24T22:24:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:24, 24 January 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Info|Function|Server|1.0.3}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Info|Function|Server|1.0.3}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{FuncDescription|Sets the host of this &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ruquest &lt;/del&gt;which is basically the domain or IP of the remote end.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{FuncDescription|Sets the host of this &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;request &lt;/ins&gt;which is basically the domain or IP of the remote end.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{FuncSyntax|http_set_host(http, host)}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{FuncSyntax|http_set_host(http, host)}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>REDRUM</name></author>
	</entry>
	<entry>
		<id>https://dev.playonset.com/index.php?title=http_set_host&amp;diff=3734&amp;oldid=prev</id>
		<title>BlueMountains: Created page with &quot;{{Info|Function|Server|1.0.3}}  {{FuncDescription|Sets the host of this ruquest which is basically the domain or IP of the remote end.}}  {{FuncSyntax|http_set_host(http, host...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dev.playonset.com/index.php?title=http_set_host&amp;diff=3734&amp;oldid=prev"/>
		<updated>2020-01-24T17:13:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Info|Function|Server|1.0.3}}  {{FuncDescription|Sets the host of this ruquest which is basically the domain or IP of the remote end.}}  {{FuncSyntax|http_set_host(http, host...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Info|Function|Server|1.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{FuncDescription|Sets the host of this ruquest which is basically the domain or IP of the remote end.}}&lt;br /&gt;
&lt;br /&gt;
{{FuncSyntax|http_set_host(http, host)}}&lt;br /&gt;
&lt;br /&gt;
{{FuncParameters}}&lt;br /&gt;
{{FuncParam|http|The http identifier.}}&lt;br /&gt;
{{FuncParam|host|The remote host.}}&lt;br /&gt;
&lt;br /&gt;
{{FuncReturnValue|Returns &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039; on success.}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Lua&amp;quot;&amp;gt;&lt;br /&gt;
function test_post()&lt;br /&gt;
	local r = http_create()&lt;br /&gt;
	http_set_resolver_protocol(r, &amp;quot;ipv4&amp;quot;)&lt;br /&gt;
	http_set_protocol(r, &amp;quot;http&amp;quot;)&lt;br /&gt;
	http_set_host(r, &amp;quot;ptsv2.com&amp;quot;)&lt;br /&gt;
	http_set_port(r, 80)&lt;br /&gt;
	http_set_target(r, &amp;quot;/t/ozoab-1577627726/post&amp;quot;)&lt;br /&gt;
	http_set_verb(r, &amp;quot;post&amp;quot;)&lt;br /&gt;
	http_set_timeout(r, 30)&lt;br /&gt;
	http_set_version(r, 11)&lt;br /&gt;
	http_set_keepalive(r, true)&lt;br /&gt;
	http_set_field(r, &amp;quot;user-agent&amp;quot;, &amp;quot;Onset Server &amp;quot;..GetGameVersionString())&lt;br /&gt;
	&lt;br /&gt;
	local body = &amp;quot;&amp;quot;&lt;br /&gt;
	body = body..&amp;quot;foo1=&amp;quot;..url_encode(&amp;quot;bar?&amp;quot;)&lt;br /&gt;
	body = body..&amp;quot;foo2=&amp;quot;..url_encode(&amp;quot;?d,_:%bar2?&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	http_set_body(r, body)&lt;br /&gt;
	http_set_field(r, &amp;quot;content-length&amp;quot;, string.len(body))&lt;br /&gt;
	http_set_field(r, &amp;quot;content-type&amp;quot;, &amp;quot;application/x-www-form-urlencoded; charset=utf-8&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	if http_send(r, OnPostComplete, 1, 3.14, &amp;quot;OK s&amp;quot;) == false then&lt;br /&gt;
		print(&amp;quot;HTTP REQ NOT SENT :(&amp;quot;)&lt;br /&gt;
		http_destroy(r)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function OnPostComplete(a, b, c)&lt;br /&gt;
	print(&amp;quot;OnPostComplete&amp;quot;, a, b, c)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{RelatedFunctions}}&lt;br /&gt;
{{HttpFunctions}}&lt;/div&gt;</summary>
		<author><name>BlueMountains</name></author>
	</entry>
</feed>