File: Poco.Net.HTTPServerResponseImpl.html

package info (click to toggle)
poco-doc 1.3.6-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 10,080 kB
  • sloc: makefile: 31
file content (104 lines) | stat: -rw-r--r-- 16,313 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Net::HTTPServerResponseImpl</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class HTTPServerResponseImpl</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> HTTPServer<br />
<b>Header:</b> Poco/Net/HTTPServerResponseImpl.h</p>
<h2>Description</h2>
<div class="description">
<p>This subclass of <a href="Poco.Net.HTTPServerResponse.html" title="class Poco::Net::HTTPServerResponse">HTTPServerResponse</a> is used for representing server-side HTTP responses. </p>
<p>A <a href="Poco.Net.HTTPServerResponse.html" title="class Poco::Net::HTTPServerResponse">HTTPServerResponse</a> is passed to the handleRequest() method of <a href="Poco.Net.HTTPRequestHandler.html" title="class Poco::Net::HTTPRequestHandler">HTTPRequestHandler</a>. </p>
<p>handleRequest() must set a status code and optional reason phrase, set headers as necessary, and provide a message body. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Net.HTTPServerResponse.html" title="class Poco::Net::HTTPServerResponse">HTTPServerResponse</a></p>
<p><b>All Base Classes: </b><a href="Poco.Net.HTTPMessage.html" title="class Poco::Net::HTTPMessage">HTTPMessage</a>, <a href="Poco.Net.HTTPResponse.html" title="class Poco::Net::HTTPResponse">HTTPResponse</a>, <a href="Poco.Net.HTTPServerResponse.html" title="class Poco::Net::HTTPServerResponse">HTTPServerResponse</a>, <a href="Poco.Net.MessageHeader.html" title="class Poco::Net::MessageHeader">MessageHeader</a>, <a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.HTTPServerResponseImpl.html#13142" title="Poco::Net::HTTPServerResponseImpl::redirect()">redirect</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13144" title="Poco::Net::HTTPServerResponseImpl::requireAuthentication()">requireAuthentication</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13135" title="Poco::Net::HTTPServerResponseImpl::send()">send</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13139" title="Poco::Net::HTTPServerResponseImpl::sendBuffer()">sendBuffer</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13134" title="Poco::Net::HTTPServerResponseImpl::sendContinue()">sendContinue</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13136" title="Poco::Net::HTTPServerResponseImpl::sendFile()">sendFile</a>, <a href="Poco.Net.HTTPServerResponseImpl.html#13146" title="Poco::Net::HTTPServerResponseImpl::sent()">sent</a></p>
<p><b>Inherited Functions: </b><a href="Poco.Net.NameValueCollection.html#14067" title="Poco::Net::NameValueCollection::add()">add</a>, <a href="Poco.Net.HTTPResponse.html#12964" title="Poco::Net::HTTPResponse::addCookie()">addCookie</a>, <a href="Poco.Net.NameValueCollection.html#14079" title="Poco::Net::NameValueCollection::begin()">begin</a>, <a href="Poco.Net.NameValueCollection.html#14085" title="Poco::Net::NameValueCollection::clear()">clear</a>, <a href="Poco.Net.NameValueCollection.html#14081" title="Poco::Net::NameValueCollection::empty()">empty</a>, <a href="Poco.Net.NameValueCollection.html#14080" title="Poco::Net::NameValueCollection::end()">end</a>, <a href="Poco.Net.NameValueCollection.html#14083" title="Poco::Net::NameValueCollection::erase()">erase</a>, <a href="Poco.Net.NameValueCollection.html#14077" title="Poco::Net::NameValueCollection::find()">find</a>, <a href="Poco.Net.NameValueCollection.html#14070" title="Poco::Net::NameValueCollection::get()">get</a>, <a href="Poco.Net.HTTPMessage.html#12781" title="Poco::Net::HTTPMessage::getChunkedTransferEncoding()">getChunkedTransferEncoding</a>, <a href="Poco.Net.HTTPMessage.html#12775" title="Poco::Net::HTTPMessage::getContentLength()">getContentLength</a>, <a href="Poco.Net.HTTPMessage.html#12786" title="Poco::Net::HTTPMessage::getContentType()">getContentType</a>, <a href="Poco.Net.HTTPResponse.html#12966" title="Poco::Net::HTTPResponse::getCookies()">getCookies</a>, <a href="Poco.Net.HTTPResponse.html#12963" title="Poco::Net::HTTPResponse::getDate()">getDate</a>, <a href="Poco.Net.HTTPMessage.html#12789" title="Poco::Net::HTTPMessage::getKeepAlive()">getKeepAlive</a>, <a href="Poco.Net.HTTPResponse.html#12955" title="Poco::Net::HTTPResponse::getReason()">getReason</a>, <a href="Poco.Net.HTTPResponse.html#12972" title="Poco::Net::HTTPResponse::getReasonForStatus()">getReasonForStatus</a>, <a href="Poco.Net.HTTPResponse.html#12950" title="Poco::Net::HTTPResponse::getStatus()">getStatus</a>, <a href="Poco.Net.HTTPMessage.html#12778" title="Poco::Net::HTTPMessage::getTransferEncoding()">getTransferEncoding</a>, <a href="Poco.Net.HTTPMessage.html#12772" title="Poco::Net::HTTPMessage::getVersion()">getVersion</a>, <a href="Poco.Net.NameValueCollection.html#14075" title="Poco::Net::NameValueCollection::has()">has</a>, <a href="Poco.Net.NameValueCollection.html#14062" title="Poco::Net::NameValueCollection::operator()">operator</a>, <a href="Poco.Net.MessageHeader.html#13915" title="Poco::Net::MessageHeader::operator =()">operator&nbsp;=</a>, <a href="Poco.Net.MessageHeader.html#13933" title="Poco::Net::MessageHeader::quote()">quote</a>, <a href="Poco.Net.HTTPResponse.html#12970" title="Poco::Net::HTTPResponse::read()">read</a>, <a href="Poco.Net.HTTPServerResponse.html#13125" title="Poco::Net::HTTPServerResponse::redirect()">redirect</a>, <a href="Poco.Net.HTTPServerResponse.html#13127" title="Poco::Net::HTTPServerResponse::requireAuthentication()">requireAuthentication</a>, <a href="Poco.Net.HTTPServerResponse.html#13118" title="Poco::Net::HTTPServerResponse::send()">send</a>, <a href="Poco.Net.HTTPServerResponse.html#13122" title="Poco::Net::HTTPServerResponse::sendBuffer()">sendBuffer</a>, <a href="Poco.Net.HTTPServerResponse.html#13117" title="Poco::Net::HTTPServerResponse::sendContinue()">sendContinue</a>, <a href="Poco.Net.HTTPServerResponse.html#13119" title="Poco::Net::HTTPServerResponse::sendFile()">sendFile</a>, <a href="Poco.Net.HTTPServerResponse.html#13129" title="Poco::Net::HTTPServerResponse::sent()">sent</a>, <a href="Poco.Net.NameValueCollection.html#14064" title="Poco::Net::NameValueCollection::set()">set</a>, <a href="Poco.Net.HTTPMessage.html#12779" title="Poco::Net::HTTPMessage::setChunkedTransferEncoding()">setChunkedTransferEncoding</a>, <a href="Poco.Net.HTTPMessage.html#12773" title="Poco::Net::HTTPMessage::setContentLength()">setContentLength</a>, <a href="Poco.Net.HTTPMessage.html#12784" title="Poco::Net::HTTPMessage::setContentType()">setContentType</a>, <a href="Poco.Net.HTTPResponse.html#12961" title="Poco::Net::HTTPResponse::setDate()">setDate</a>, <a href="Poco.Net.HTTPMessage.html#12787" title="Poco::Net::HTTPMessage::setKeepAlive()">setKeepAlive</a>, <a href="Poco.Net.HTTPResponse.html#12953" title="Poco::Net::HTTPResponse::setReason()">setReason</a>, <a href="Poco.Net.HTTPResponse.html#12948" title="Poco::Net::HTTPResponse::setStatus()">setStatus</a>, <a href="Poco.Net.HTTPResponse.html#12956" title="Poco::Net::HTTPResponse::setStatusAndReason()">setStatusAndReason</a>, <a href="Poco.Net.HTTPMessage.html#12776" title="Poco::Net::HTTPMessage::setTransferEncoding()">setTransferEncoding</a>, <a href="Poco.Net.HTTPMessage.html#12770" title="Poco::Net::HTTPMessage::setVersion()">setVersion</a>, <a href="Poco.Net.NameValueCollection.html#14082" title="Poco::Net::NameValueCollection::size()">size</a>, <a href="Poco.Net.MessageHeader.html#13921" title="Poco::Net::MessageHeader::splitElements()">splitElements</a>, <a href="Poco.Net.MessageHeader.html#13925" title="Poco::Net::MessageHeader::splitParameters()">splitParameters</a>, <a href="Poco.Net.NameValueCollection.html#14060" title="Poco::Net::NameValueCollection::swap()">swap</a>, <a href="Poco.Net.HTTPResponse.html#12968" title="Poco::Net::HTTPResponse::write()">write</a></p>
<h2>Constructors</h2>
<h3><a name="13131">HTTPServerResponseImpl</a></h3>
<p class="decl"><a href="Poco.Net.HTTPServerResponseImpl.html" title="class Poco::Net::HTTPServerResponseImpl">HTTPServerResponseImpl</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Net.HTTPServerSession.html" title="class Poco::Net::HTTPServerSession">HTTPServerSession</a> &amp; session<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Net.HTTPServerResponseImpl.html" title="class Poco::Net::HTTPServerResponseImpl">HTTPServerResponseImpl</a>. </p>
</div>
<h2>Destructor</h2>
<h3><a name="13133">~HTTPServerResponseImpl</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.Net.HTTPServerResponseImpl.html" title="class Poco::Net::HTTPServerResponseImpl">HTTPServerResponseImpl</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.HTTPServerResponseImpl.html" title="class Poco::Net::HTTPServerResponseImpl">HTTPServerResponseImpl</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="13142">redirect</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void redirect(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; uri<br />);</p>
<div class="description">
<p>Sets the status code to 302 (Found) and sets the &quot;Location&quot; header field to the given <a href="Poco.URI.html" title="class Poco::URI">URI</a>, which according to the HTTP specification, must be absolute. </p>
<p>Must not be called after <a href="Poco.Net.HTTPServerResponseImpl.html#13135" title="Poco::Net::HTTPServerResponseImpl::send()">send</a>() has been called. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13125" title="Poco::Net::HTTPServerResponse::redirect()">Poco::Net::HTTPServerResponse::redirect()</a></p></div>
<h3><a name="13144">requireAuthentication</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void requireAuthentication(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; realm<br />);</p>
<div class="description">
<p>Sets the status code to 401 (Unauthorized) and sets the &quot;WWW-Authenticate&quot; header field according to the given realm. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13127" title="Poco::Net::HTTPServerResponse::requireAuthentication()">Poco::Net::HTTPServerResponse::requireAuthentication()</a></p></div>
<h3><a name="13135">send</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::ostream &amp; send();</p>
<div class="description">
<p>Sends the response header to the client and returns an output stream for sending the response body. </p>
<p>The returned stream is valid until the response object is destroyed. </p>
<p>Must not be called after <a href="Poco.Net.HTTPServerResponseImpl.html#13136" title="Poco::Net::HTTPServerResponseImpl::sendFile()">sendFile</a>(), <a href="Poco.Net.HTTPServerResponseImpl.html#13139" title="Poco::Net::HTTPServerResponseImpl::sendBuffer()">sendBuffer</a>()  or <a href="Poco.Net.HTTPServerResponseImpl.html#13142" title="Poco::Net::HTTPServerResponseImpl::redirect()">redirect</a>() has been called. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13118" title="Poco::Net::HTTPServerResponse::send()">Poco::Net::HTTPServerResponse::send()</a></p></div>
<h3><a name="13139">sendBuffer</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void sendBuffer(<br />&nbsp;&nbsp;&nbsp;&nbsp;const void * pBuffer,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::size_t length<br />);</p>
<div class="description">
<p>Sends the response header to the client, followed by the contents of the given buffer. </p>
<p>The Content-Length header of the response is set to length and chunked transfer encoding is disabled. </p>
<p>If both the HTTP message header and body (from the given buffer) fit into one single network packet, the  complete response can be sent in one network packet. </p>
<p>Must not be called after <a href="Poco.Net.HTTPServerResponseImpl.html#13135" title="Poco::Net::HTTPServerResponseImpl::send()">send</a>(), <a href="Poco.Net.HTTPServerResponseImpl.html#13136" title="Poco::Net::HTTPServerResponseImpl::sendFile()">sendFile</a>()   or <a href="Poco.Net.HTTPServerResponseImpl.html#13142" title="Poco::Net::HTTPServerResponseImpl::redirect()">redirect</a>() has been called. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13122" title="Poco::Net::HTTPServerResponse::sendBuffer()">Poco::Net::HTTPServerResponse::sendBuffer()</a></p></div>
<h3><a name="13134">sendContinue</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void sendContinue();</p>
<div class="description">
<p>Sends a 100 Continue response to the client. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13117" title="Poco::Net::HTTPServerResponse::sendContinue()">Poco::Net::HTTPServerResponse::sendContinue()</a></p></div>
<h3><a name="13136">sendFile</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void sendFile(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; path,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; mediaType<br />);</p>
<div class="description">
<p>Sends the response header to the client, followed by the content of the given file. </p>
<p>Must not be called after <a href="Poco.Net.HTTPServerResponseImpl.html#13135" title="Poco::Net::HTTPServerResponseImpl::send()">send</a>(), <a href="Poco.Net.HTTPServerResponseImpl.html#13139" title="Poco::Net::HTTPServerResponseImpl::sendBuffer()">sendBuffer</a>()  or <a href="Poco.Net.HTTPServerResponseImpl.html#13142" title="Poco::Net::HTTPServerResponseImpl::redirect()">redirect</a>() has been called. </p>
<p>Throws a <a href="Poco.FileNotFoundException.html" title="class Poco::FileNotFoundException">FileNotFoundException</a> if the file cannot be found, or an <a href="Poco.OpenFileException.html" title="class Poco::OpenFileException">OpenFileException</a> if the file cannot be opened. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13119" title="Poco::Net::HTTPServerResponse::sendFile()">Poco::Net::HTTPServerResponse::sendFile()</a></p></div>
<h3><a name="13146">sent</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool sent() const;</p>
<div class="description">
<p>Returns true if the response (header) has been sent. </p>
</div>
<div class="description"><p><b>See also:</b> <a href="Poco.Net.HTTPServerResponse.html#13129" title="Poco::Net::HTTPServerResponse::sent()">Poco::Net::HTTPServerResponse::sent()</a></p></div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>