<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Uknickm</id>
	<title>AOLserver Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Uknickm"/>
	<link rel="alternate" type="text/html" href="https://panoptic.com/wiki/aolserver/Special:Contributions/Uknickm"/>
	<updated>2026-04-05T22:13:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_http&amp;diff=5335</id>
		<title>Ns http</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_http&amp;diff=5335"/>
		<updated>2009-06-28T14:12:11Z</updated>

		<summary type="html">&lt;p&gt;Uknickm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;manpage&amp;gt;ns_http&amp;lt;/manpage&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_http - Simple HTTP client functionality&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_http''' ''option ?arg arg ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command provides a simple HTTP client mechanism.&lt;br /&gt;
&lt;br /&gt;
: The legal ''option''s (which may be abbreviated) are:&lt;br /&gt;
:* '''ns_http cancel''' ''id''&lt;br /&gt;
:* '''ns_http cleanup'''&lt;br /&gt;
:* '''ns_http queue''' ''method url ?body? ?headers?''&lt;br /&gt;
&lt;br /&gt;
: ''body'' is the value which will be sent as the HTTP request body.  ''headers'' is the [[ns_set]] ID containing the additional headers to include in the HTTP request.&lt;br /&gt;
:* '''ns_http wait''' ''id resultsVar ?timeout? ?headers? ?-servicetime svcTime?''&lt;br /&gt;
&lt;br /&gt;
: ''resultsVar'' is the name of a variable that should be used to store the HTTP response body.  Default ''timeout'' is &amp;quot;2:0&amp;quot; (2s, 0usec).  ''headers'' is the [[ns_set]] ID which will receive the headers from the HTTP response.&lt;br /&gt;
&lt;br /&gt;
Please note that in AOLserver 4.5 the API for ns_http has been enhanced, please see the section '''USAGE IN AOLSERVER 4.5''' below.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
Valid HTTP GET:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  % set id [ns_http queue GET http://aolserver.com/]&lt;br /&gt;
  http0&lt;br /&gt;
  % set status [ns_http wait $id results]&lt;br /&gt;
  1&lt;br /&gt;
  % string range $results 0 60&lt;br /&gt;
  &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timed out HTTP GET:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  % set id [ns_http queue GET http://aolserver.com:12345/]&lt;br /&gt;
  http0&lt;br /&gt;
  % set status [ns_http wait $id results 0]&lt;br /&gt;
  0&lt;br /&gt;
  % set results&lt;br /&gt;
  timeout&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bogus HTTP GET:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  % catch {ns_http queue GET http://nonexistant.domain/} err&lt;br /&gt;
  1&lt;br /&gt;
  % set err&lt;br /&gt;
  could not connect to : http://nonexistant.domain/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''USAGE IN AOLSERVER 4.5'''&lt;br /&gt;
&lt;br /&gt;
In AOLserver 4.5 the ns_http command has been enhanced. Currently only ns_http queue and ns_http wait are documented. If you have documentation for ns_http cancel and ns_http cleanup please add it to this section. &lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: ''timeout'' is the timeout for the request, ''method'' is the method for the request, ''body'' is the body to be sent with the request and ''headers'' is an [[ns_set]] containing headers to be sent with the request.&lt;br /&gt;
&lt;br /&gt;
:* '''ns_http queue''' ''?-timeout timeout? ?-method method? ?-body body? ?-headers headers? url''&lt;br /&gt;
&lt;br /&gt;
: ''resultVar'' is the variable into which the body of the response is to be set, ''elapsedVar'' is a variable into which the elapsed time for the request is set, ''headersVar'' is an [[ns_set]] into which the response headers are set and ''statusVar'' is a variable into which the status line of the response is set.&lt;br /&gt;
&lt;br /&gt;
:* '''ns_http wait''' ''-result resultVar ?-elapsed elapsedVar? ?-headers headersVar? ?-status statusVar? id''&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLE'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  set timeout 30 &lt;br /&gt;
  set method GET&lt;br /&gt;
  set body &amp;quot;&amp;quot;&lt;br /&gt;
  set outputheaders [ns_set create outputheaders]&lt;br /&gt;
  set headersVar [ns_set create headersVar]&lt;br /&gt;
  set url http://www.aolserver.com/&lt;br /&gt;
&lt;br /&gt;
  set id [ns_http queue -timeout $timeout -method $method -body $body -headers $outputheaders $url]&lt;br /&gt;
&lt;br /&gt;
  set status [ns_http wait -elapsed elapsedVar -result resultVar -headers $headersVar -status statusVar $id]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_httpopen]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Uknickm</name></author>
		
	</entry>
</feed>