<?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_target</id>
	<title>http set target - 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_target"/>
	<link rel="alternate" type="text/html" href="https://dev.playonset.com/index.php?title=http_set_target&amp;action=history"/>
	<updated>2026-04-24T11:28:05Z</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_target&amp;diff=3732&amp;oldid=prev</id>
		<title>BlueMountains: Created page with &quot;{{Info|Function|Server|1.0.3}}  {{FuncDescription|Sets the request target which is basically the path that you want to access.}}  {{FuncSyntax|http_set_target(http, target)}}...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dev.playonset.com/index.php?title=http_set_target&amp;diff=3732&amp;oldid=prev"/>
		<updated>2020-01-24T17:11:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Info|Function|Server|1.0.3}}  {{FuncDescription|Sets the request target which is basically the path that you want to access.}}  {{FuncSyntax|http_set_target(http, target)}}...&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 request target which is basically the path that you want to access.}}&lt;br /&gt;
&lt;br /&gt;
{{FuncSyntax|http_set_target(http, target)}}&lt;br /&gt;
&lt;br /&gt;
{{FuncParameters}}&lt;br /&gt;
{{FuncParam|http|The http identifier.}}&lt;br /&gt;
{{FuncParam|target|The target path as a string.}}&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>