⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpion_1_1_h_t_t_p_response.html

📁 用c++编写http server的源码库,对socket等网络处理的代码可迅速转为己用.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
          <td></td>          <td class="paramtype">const std::string &amp;&nbsp;</td>          <td class="paramname"> <em>value</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const std::string &amp;&nbsp;</td>          <td class="paramname"> <em>path</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const unsigned long&nbsp;</td>          <td class="paramname"> <em>max_age</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"><code> [inline]</code></td>        </tr>      </table></div><div class="memdoc"><p>sets a cookie by adding a Set-Cookie header (see RFC 2109)<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>the value of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>the path of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>max_age</em>&nbsp;</td><td>the life of the cookie, in seconds (0 = discard) </td></tr>  </table></dl><p>Definition at line <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00150">150</a> of file <a class="el" href="_h_t_t_p_response_8hpp-source.html">HTTPResponse.hpp</a>.<p>References <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00111">addHeader()</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00036">pion::HTTPTypes::HEADER_SET_COOKIE</a>, and <a class="el" href="_h_t_t_p_response_8cpp-source.html#l00095">makeSetCookieHeader()</a>.</div></div><p><a class="anchor" name="4a4e5eb443e03d4bb2cbb9d69232ea5d"></a><!-- doxytag: member="pion::HTTPResponse::setCookie" ref="4a4e5eb443e03d4bb2cbb9d69232ea5d" args="(const std::string &amp;name, const std::string &amp;value, const unsigned long max_age)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void pion::HTTPResponse::setCookie           </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>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const unsigned long&nbsp;</td>          <td class="paramname"> <em>max_age</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"><code> [inline]</code></td>        </tr>      </table></div><div class="memdoc"><p>sets a cookie by adding a Set-Cookie header (see RFC 2109)<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>the value of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>max_age</em>&nbsp;</td><td>the life of the cookie, in seconds (0 = discard) </td></tr>  </table></dl><p>Definition at line <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00164">164</a> of file <a class="el" href="_h_t_t_p_response_8hpp-source.html">HTTPResponse.hpp</a>.<p>References <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00111">addHeader()</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00036">pion::HTTPTypes::HEADER_SET_COOKIE</a>, and <a class="el" href="_h_t_t_p_response_8cpp-source.html#l00095">makeSetCookieHeader()</a>.</div></div><p><a class="anchor" name="ca27596209b962252fc2afc998de6978"></a><!-- doxytag: member="pion::HTTPResponse::send" ref="ca27596209b962252fc2afc998de6978" args="(TCPConnectionPtr &amp;tcp_conn)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void pion::HTTPResponse::send           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="namespacepion.html#1858b89656b28c6498ad9efd6b7e9d41">TCPConnectionPtr</a> &amp;&nbsp;</td>          <td class="paramname"> <em>tcp_conn</em>          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>sends the response<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>tcp_conn</em>&nbsp;</td><td>TCP connection used to send the response </td></tr>  </table></dl><p>Definition at line <a class="el" href="_h_t_t_p_response_8cpp-source.html#l00019">19</a> of file <a class="el" href="_h_t_t_p_response_8cpp-source.html">HTTPResponse.cpp</a>.<p>References <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00037">pion::HTTPTypes::HEADER_CONNECTION</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00039">pion::HTTPTypes::HEADER_CONTENT_LENGTH</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00038">pion::HTTPTypes::HEADER_CONTENT_TYPE</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00031">pion::HTTPTypes::HEADER_NAME_VALUE_DELIMINATOR</a>, <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00029">pion::HTTPTypes::STRING_CRLF</a>, and <a class="el" href="_h_t_t_p_types_8hpp-source.html#l00030">pion::HTTPTypes::STRING_HTTP_VERSION</a>.</div></div><p><a class="anchor" name="756f5272417267ec27de4fc7cd7ababf"></a><!-- doxytag: member="pion::HTTPResponse::makeSetCookieHeader" ref="756f5272417267ec27de4fc7cd7ababf" args="(const std::string &amp;name, const std::string &amp;value, const std::string &amp;path, const bool has_max_age=false, const unsigned long max_age=0)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">std::string pion::HTTPResponse::makeSetCookieHeader           </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>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const std::string &amp;&nbsp;</td>          <td class="paramname"> <em>path</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const bool&nbsp;</td>          <td class="paramname"> <em>has_max_age</em> = <code>false</code>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const unsigned long&nbsp;</td>          <td class="paramname"> <em>max_age</em> = <code>0</code></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"><code> [protected]</code></td>        </tr>      </table></div><div class="memdoc"><p>creates a "Set-Cookie" header<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>the value of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>the path of the cookie </td></tr>    <tr><td valign="top"></td><td valign="top"><em>has_max_age</em>&nbsp;</td><td>true if the max_age value should be set </td></tr>    <tr><td valign="top"></td><td valign="top"><em>max_age</em>&nbsp;</td><td>the life of the cookie, in seconds (0 = discard)</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the new "Set-Cookie" header </dd></dl><p>Definition at line <a class="el" href="_h_t_t_p_response_8cpp-source.html#l00095">95</a> of file <a class="el" href="_h_t_t_p_response_8cpp-source.html">HTTPResponse.cpp</a>.<p>Referenced by <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00172">deleteCookie()</a>, and <a class="el" href="_h_t_t_p_response_8hpp-source.html#l00122">setCookie()</a>.</div></div><p><hr>The documentation for this class was generated from the following files:<ul><li>/Users/mdickey/code/libpion-export/include/libpion/<a class="el" href="_h_t_t_p_response_8hpp-source.html">HTTPResponse.hpp</a><li>/Users/mdickey/code/libpion-export/src/<a class="el" href="_h_t_t_p_response_8cpp-source.html">HTTPResponse.cpp</a></ul><hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 19 13:29:23 2007 for libpion by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -