<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/15803" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2008-06-02T10:47:47-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/15803</id>

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-06-02T10:47:47-04:00</updated>

		<published>2008-06-02T10:47:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83376#p83376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83376#p83376"/>
		<title type="html"><![CDATA[HTTP misunderstandings!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83376#p83376"><![CDATA[
Well, this would be accomplished in a few steps:<br>1st, use ::http:geturl to retrieve the page:<div class="codebox"><p>Code: </p><pre><code>set token [::http::geturl $url]</code></pre></div>2nd, get the content, and parse it if necessary :<div class="codebox"><p>Code: </p><pre><code>set data [::http::data $token]#parse $data and so on...</code></pre></div>3rd, construct the query to be sent with your POST:<div class="codebox"><p>Code: </p><pre><code>set q [::http::formatQuery key1 value1 key2 value2]</code></pre></div>4th, use ::http::geturl to POST the new query:<div class="codebox"><p>Code: </p><pre><code>set token2 [::http::geturl $url -query $q]</code></pre></div>5th, get the content<div class="codebox"><p>Code: </p><pre><code>set data2 [::http::data $token2]</code></pre></div>Since you are running this under eggdrop, it would be advisable to use the callback function of geturl, as to prevent your eggdrop from freezing.<br>Also, this was a very lazy example, where I simply assume the http-transaction went by flawlessly, and thus do not check for any errors or such.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 02, 2008 10:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Neeq]]></name></author>
		<updated>2008-06-02T10:22:41-04:00</updated>

		<published>2008-06-02T10:22:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83375#p83375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83375#p83375"/>
		<title type="html"><![CDATA[HTTP misunderstandings!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83375#p83375"><![CDATA[
Hey guys,<br><br>I've been learned TCL on and off for a while and decided to have a go at tcl::http, but I have hit a brick wall and the documentation isn't the clearest thing in the world.<br><br>What I want to do is have the script access a page ( example: <a href="http://ex.com/?add" class="postlink">http://ex.com/?add</a> ), then use POST to send data.<br><br>I have looked at the documentation for it but didn't really find any clues other than basic examples of ::http::geturl.<br><br>Any help will be appreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8758">Neeq</a> — Mon Jun 02, 2008 10:22 am</p><hr />
]]></content>
	</entry>
	</feed>
