Apache-ASP
view release on metacpan or search on metacpan
site/objects.html view on Meta::CPAN
before global.asa Script_OnStart is called, so
global script termination may be correctly handled
during that event, which one might want to do
with excessive user STOP/RELOADS when the web
server is very busy.
<font face="courier new" size=3><pre>
</pre></font>An API extension $Response->IsClientConnected
may be called for refreshed connection status
without calling first a $Response->Flush</font>
<p>
<a name=%24Response-%3E%7Bc48a3e9e></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->{PICS}</b></font>
<font face="courier new" size=3><pre>
</pre></font>If this property has been set, a PICS-Label HTTP header will be
sent with its value. For those that do not know, PICS is a header
that is useful in rating the internet. It stands for
Platform for Internet Content Selection, and you can find more
info about it at: <a href=http://www.w3.org>http://www.w3.org</a></font>
<p>
<a name=%24Response-%3E%7B7098f2f6></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->{Status} = $status</b></font>
<font face="courier new" size=3><pre>
</pre></font>Sets the status code returned by the server. Can be used to
set messages like 500, internal server error</font>
<p>
<a name=%24Response-%3EA8c17d8af></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->AddHeader($name, $value)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Adds a custom header to a web page. Headers are sent only before any
text from the main page is sent, so if you want to set a header
after some text on a page, you must turn BufferingOn.</font>
<p>
<a name=%24Response-%3EA1b47bb43></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->AppendToLog($message)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Adds $message to the server log. Useful for debugging.</font>
<p>
<a name=%24Response-%3EB202b8013></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->BinaryWrite($data)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Writes binary data to the client. The only
difference from $Response->Write() is that $Response->Flush()
is called internally first, so the data cannot be parsed
as an html header. Flushing flushes the header if has not
already been written.
<font face="courier new" size=3><pre>
</pre></font>If you have set the $Response->{ContentType}
to something other than text/html, cgi header parsing (see <a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a>
notes), will be automatically be turned off, so you will not
necessarily need to use BinaryWrite for writing binary data.
<font face="courier new" size=3><pre>
</pre></font>For an example of BinaryWrite, see the binary_write.htm example
in <a href=eg/binary_write.htm>./site/eg/binary_write.htm</a>
<font face="courier new" size=3><pre>
</pre></font>Please note that if you are on Win32, you will need to
call binmode on a file handle before reading, if
its data is binary.</font>
<p>
<a name=%24Response-%3EC08958c05></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Clear()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Erases buffered ASP output.</font>
<p>
<a name=%24Response-%3ECd77d06d7></a>
<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Cookies($name, [$key,] $value)</b></font>
<font face="courier new" size=3><pre>
</pre></font>Sets the key or attribute of cookie with name $name to the value $value.
If $key is not defined, the Value of the cookie is set.
ASP CookiePath is assumed to be / in these examples.
<font face="courier new" size=3><pre>
$Response->Cookies('name', 'value');
--> Set-Cookie: name=value; path=/
$Response->Cookies("Test", "data1", "test value");
$Response->Cookies("Test", "data2", "more test");
$Response->Cookies(
"Test", "Expires",
&HTTP::Date::time2str(time+86400)
);
$Response->Cookies("Test", "Secure", 1);
$Response->Cookies("Test", "Path", "/");
$Response->Cookies("Test", "Domain", "host.com");
--> Set-Cookie:Test=data1=test%20value&data2=more%20test; \
expires=Fri, 23 Apr 1999 07:19:52 GMT; \
path=/; domain=host.com; secure
</pre></font>The latter use of $key in the cookies not only sets cookie attributes
such as Expires, but also treats the cookie as a hash of key value pairs
which can later be accesses by
<font face="courier new" size=3><pre>
$Request->Cookies('Test', 'data1');
$Request->Cookies('Test', 'data2');
</pre></font>Because this is perl, you can (NOT PORTABLE) reference the cookies
directly through hash notation. The same 5 commands above could be compressed to:
<font face="courier new" size=3><pre>
$Response->{Cookies}{Test} =
{
Secure => 1,
Value =>
{
data1 => 'test value',
data2 => 'more test'
},
Expires => 86400, # not portable, see above
Domain => 'host.com',
Path => '/'
};
</pre></font>and the first command would be:
<font face="courier new" size=3><pre>
# you don't need to use hash notation when you are only setting
# a simple value
$Response->{Cookies}{'Test Name'} = 'Test Value';
</pre></font>I prefer the hash notation for cookies, as this looks nice, and is
quite perlish. It is here to stay. The Cookie() routine is
very complex and does its best to allow access to the
( run in 0.748 second using v1.01-cache-2.11-cpan-d8267643d1d )