File: classWt_1_1Http_1_1Response.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (197 lines) | stat: -rw-r--r-- 11,786 bytes parent folder | download
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::Http::Response Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="namespaceWt_1_1Http.html">Http</a>::<a class="el" href="classWt_1_1Http_1_1Response.html">Response</a>
  </div>
</div>
<div class="contents">
<h1>Wt::Http::Response Class Reference</h1><!-- doxytag: class="Wt::Http::Response" -->An HTTP response.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;Wt/Http/Response&gt;</code>
<p>

<p>
<a href="classWt_1_1Http_1_1Response-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#7c14ba3ab34ff14461df3a4369118443">setStatus</a> (int status)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the response status.  <a href="#7c14ba3ab34ff14461df3a4369118443"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#20dd49d512ffc0cf407f9dd39db30341">setMimeType</a> (const std::string &amp;mimeType)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the content mime type.  <a href="#20dd49d512ffc0cf407f9dd39db30341"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#5827dd04629251d0c7ff3cc9062afb7d">addHeader</a> (const std::string &amp;name, const std::string &amp;value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add an HTTP header.  <a href="#5827dd04629251d0c7ff3cc9062afb7d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1Http_1_1ResponseContinuation.html">ResponseContinuation</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#5cb0800718188328fec17d3b84c85aab">createContinuation</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a continuation object for this response.  <a href="#5cb0800718188328fec17d3b84c85aab"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1Http_1_1ResponseContinuation.html">ResponseContinuation</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#d29d222d15779421a840f8974f07b304">continuation</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the continuation, if one was created for this response.  <a href="#d29d222d15779421a840f8974f07b304"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e74ee0009e9ec4aa3d3f35e680a745de"></a><!-- doxytag: member="Wt::Http::Response::out" ref="e74ee0009e9ec4aa3d3f35e680a745de" args="()" -->
std::ostream &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#e74ee0009e9ec4aa3d3f35e680a745de">out</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the stream for getting the response output. <br></td></tr>
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c331572ec8a235b3ebf1030c5614cdec"></a><!-- doxytag: member="Wt::Http::Response::Wt::WResource" ref="c331572ec8a235b3ebf1030c5614cdec" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Response.html#c331572ec8a235b3ebf1030c5614cdec">Wt::WResource</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
An HTTP response. 
<p>
Use the HTTP response to format a response to an HTTP request (see <a class="el" href="classWt_1_1Http_1_1Request.html" title="An HTTP request.">Request</a>).<p>
More specifically you can:<ul>
<li>set the content mime type using <a class="el" href="classWt_1_1Http_1_1Response.html#20dd49d512ffc0cf407f9dd39db30341" title="Set the content mime type.">setMimeType()</a></li><li>add HTTP headers using <a class="el" href="classWt_1_1Http_1_1Response.html#5827dd04629251d0c7ff3cc9062afb7d" title="Add an HTTP header.">addHeader()</a></li><li>stream content into <a class="el" href="classWt_1_1Http_1_1Response.html#e74ee0009e9ec4aa3d3f35e680a745de" title="Returns the stream for getting the response output.">out()</a></li></ul>
<p>
You may chose to provide only a partial response. In that case, use <a class="el" href="classWt_1_1Http_1_1Response.html#5cb0800718188328fec17d3b84c85aab" title="Create a continuation object for this response.">createContinuation()</a> to create a continuation object to which you can annotate information for the next request to process the response further.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WResource.html#3a740f8cc29e2e6e4e58defc9c88b8b6" title="Handles a request.">WResource::handleRequest()</a> </dd></dl>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="7c14ba3ab34ff14461df3a4369118443"></a><!-- doxytag: member="Wt::Http::Response::setStatus" ref="7c14ba3ab34ff14461df3a4369118443" args="(int status)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Response::setStatus           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>status</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the response status. 
<p>
Unless a overriden, 200 OK will be assumed. 
</div>
</div><p>
<a class="anchor" name="20dd49d512ffc0cf407f9dd39db30341"></a><!-- doxytag: member="Wt::Http::Response::setMimeType" ref="20dd49d512ffc0cf407f9dd39db30341" args="(const std::string &amp;mimeType)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Response::setMimeType           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>mimeType</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the content mime type. 
<p>
The content mimetype is used by the browser to correctly interpret the resource. 
</div>
</div><p>
<a class="anchor" name="5827dd04629251d0c7ff3cc9062afb7d"></a><!-- doxytag: member="Wt::Http::Response::addHeader" ref="5827dd04629251d0c7ff3cc9062afb7d" args="(const std::string &amp;name, const std::string &amp;value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Response::addHeader           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add an HTTP header. 
<p>
Headers may be added only before setting the content mime-type (<a class="el" href="classWt_1_1Http_1_1Response.html#20dd49d512ffc0cf407f9dd39db30341" title="Set the content mime type.">setMimeType()</a>), and before streaming any data to the <a class="el" href="classWt_1_1Http_1_1Response.html#e74ee0009e9ec4aa3d3f35e680a745de" title="Returns the stream for getting the response output.">out()</a> stream. 
</div>
</div><p>
<a class="anchor" name="5cb0800718188328fec17d3b84c85aab"></a><!-- doxytag: member="Wt::Http::Response::createContinuation" ref="5cb0800718188328fec17d3b84c85aab" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Http_1_1ResponseContinuation.html">ResponseContinuation</a> * Wt::Http::Response::createContinuation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a continuation object for this response. 
<p>
By creating a continuation object, a new request will be made for the resource to retrieve more data, after the current data has been sent out.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Response.html#d29d222d15779421a840f8974f07b304" title="Return the continuation, if one was created for this response.">continuation()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="d29d222d15779421a840f8974f07b304"></a><!-- doxytag: member="Wt::Http::Response::continuation" ref="d29d222d15779421a840f8974f07b304" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Http_1_1ResponseContinuation.html">ResponseContinuation</a> * Wt::Http::Response::continuation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the continuation, if one was created for this response. 
<p>
Returns the continuation that was previously created using <a class="el" href="classWt_1_1Http_1_1Response.html#5cb0800718188328fec17d3b84c85aab" title="Create a continuation object for this response.">createContinuation()</a>, or 0 if no continuation was created yet.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Response.html#5cb0800718188328fec17d3b84c85aab" title="Create a continuation object for this response.">createContinuation()</a> </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:08 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>