mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 17:56:16 +00:00
462 lines
26 KiB
HTML
462 lines
26 KiB
HTML
<!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>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Dash Core: HTTPRequest Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(initResizable);
|
|
/* @license-end */</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Dash Core
|
|
 <span id="projectnumber">0.12.2.1</span>
|
|
</div>
|
|
<div id="projectbrief">P2P Digital Currency</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('classHTTPRequest.html','');});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pri-attribs">Private Attributes</a> |
|
|
<a href="classHTTPRequest-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">HTTPRequest Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="httpserver_8h_source.html">httpserver.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:a1afe92e9caad997b8f88f0cb07dcc5aa"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aa">RequestMethod</a> { <br />
|
|
  <a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aaae2331c29519b3237f4926d5be5f7c7a4">UNKNOWN</a>,
|
|
<a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aaa066288ebc3abf9337c20f7d69a7cb77f">GET</a>,
|
|
<a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aaac8de8b5303c92a9f833e9e68c18d02d9">POST</a>,
|
|
<a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aaaed9ed095188e3bc8f7235e41972afbe9">HEAD</a>,
|
|
<br />
|
|
  <a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aaa86909f8f99c1272199518e4eb860e175">PUT</a>
|
|
<br />
|
|
}</td></tr>
|
|
<tr class="separator:a1afe92e9caad997b8f88f0cb07dcc5aa"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:aab94919073c53e2302a653cb0c91a7d5"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#aab94919073c53e2302a653cb0c91a7d5">HTTPRequest</a> (struct evhttp_request *<a class="el" href="classHTTPRequest.html#aa8b4243a4a15afaa00b3b47947fcfea3">req</a>)</td></tr>
|
|
<tr class="separator:aab94919073c53e2302a653cb0c91a7d5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab5864e916f43eddde9d2ccb69e0f1385"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#ab5864e916f43eddde9d2ccb69e0f1385">~HTTPRequest</a> ()</td></tr>
|
|
<tr class="separator:ab5864e916f43eddde9d2ccb69e0f1385"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a53a138e588e5326d6c87bb84029f43e9"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a53a138e588e5326d6c87bb84029f43e9">GetURI</a> ()</td></tr>
|
|
<tr class="separator:a53a138e588e5326d6c87bb84029f43e9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a73ba24bc6528fd1aa5024c10330bfdfb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCService.html">CService</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a73ba24bc6528fd1aa5024c10330bfdfb">GetPeer</a> ()</td></tr>
|
|
<tr class="separator:a73ba24bc6528fd1aa5024c10330bfdfb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afc79079a153c70240914617a9dde075d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aa">RequestMethod</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#afc79079a153c70240914617a9dde075d">GetRequestMethod</a> ()</td></tr>
|
|
<tr class="separator:afc79079a153c70240914617a9dde075d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7d31adee3f9e93edea6d9a5bd4454aae"><td class="memItemLeft" align="right" valign="top">std::pair< bool, std::string > </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a7d31adee3f9e93edea6d9a5bd4454aae">GetHeader</a> (const std::string &hdr)</td></tr>
|
|
<tr class="separator:a7d31adee3f9e93edea6d9a5bd4454aae"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad0dc256f16fe6d13022958d64b7a22a0"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#ad0dc256f16fe6d13022958d64b7a22a0">ReadBody</a> ()</td></tr>
|
|
<tr class="separator:ad0dc256f16fe6d13022958d64b7a22a0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a910ea3b361715e036dc74eb75e92fb62"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a910ea3b361715e036dc74eb75e92fb62">WriteHeader</a> (const std::string &hdr, const std::string &value)</td></tr>
|
|
<tr class="separator:a910ea3b361715e036dc74eb75e92fb62"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a43767ec5daf58e5a13a740ed56ddca3f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a43767ec5daf58e5a13a740ed56ddca3f">WriteReply</a> (int nStatus, const std::string &strReply="")</td></tr>
|
|
<tr class="separator:a43767ec5daf58e5a13a740ed56ddca3f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
|
Private Attributes</h2></td></tr>
|
|
<tr class="memitem:aa8b4243a4a15afaa00b3b47947fcfea3"><td class="memItemLeft" align="right" valign="top">struct evhttp_request * </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#aa8b4243a4a15afaa00b3b47947fcfea3">req</a></td></tr>
|
|
<tr class="separator:aa8b4243a4a15afaa00b3b47947fcfea3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1267b5e169b279bdbce5ea9c90f04483"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classHTTPRequest.html#a1267b5e169b279bdbce5ea9c90f04483">replySent</a></td></tr>
|
|
<tr class="separator:a1267b5e169b279bdbce5ea9c90f04483"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>In-flight HTTP request. Thin C++ wrapper around evhttp_request. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8h_source.html#l00055">55</a> of file <a class="el" href="httpserver_8h_source.html">httpserver.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="a1afe92e9caad997b8f88f0cb07dcc5aa"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1afe92e9caad997b8f88f0cb07dcc5aa">◆ </a></span>RequestMethod</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aa">HTTPRequest::RequestMethod</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a1afe92e9caad997b8f88f0cb07dcc5aaae2331c29519b3237f4926d5be5f7c7a4"></a>UNKNOWN </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="a1afe92e9caad997b8f88f0cb07dcc5aaa066288ebc3abf9337c20f7d69a7cb77f"></a>GET </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="a1afe92e9caad997b8f88f0cb07dcc5aaac8de8b5303c92a9f833e9e68c18d02d9"></a>POST </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="a1afe92e9caad997b8f88f0cb07dcc5aaaed9ed095188e3bc8f7235e41972afbe9"></a>HEAD </td><td class="fielddoc"></td></tr>
|
|
<tr><td class="fieldname"><a id="a1afe92e9caad997b8f88f0cb07dcc5aaa86909f8f99c1272199518e4eb860e175"></a>PUT </td><td class="fielddoc"></td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8h_source.html#l00065">65</a> of file <a class="el" href="httpserver_8h_source.html">httpserver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="aab94919073c53e2302a653cb0c91a7d5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aab94919073c53e2302a653cb0c91a7d5">◆ </a></span>HTTPRequest()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">HTTPRequest::HTTPRequest </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct evhttp_request * </td>
|
|
<td class="paramname"><em>req</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00554">554</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab5864e916f43eddde9d2ccb69e0f1385"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab5864e916f43eddde9d2ccb69e0f1385">◆ </a></span>~HTTPRequest()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">HTTPRequest::~HTTPRequest </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00558">558</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a7d31adee3f9e93edea6d9a5bd4454aae"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7d31adee3f9e93edea6d9a5bd4454aae">◆ </a></span>GetHeader()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::pair< bool, std::string > HTTPRequest::GetHeader </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>hdr</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get the request header specified by hdr, or an empty string. Return an pair (isPresent,string). </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00568">568</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a73ba24bc6528fd1aa5024c10330bfdfb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a73ba24bc6528fd1aa5024c10330bfdfb">◆ </a></span>GetPeer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classCService.html">CService</a> HTTPRequest::GetPeer </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get <a class="el" href="classCService.html">CService</a> (address:ip) for the origin of the http request. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00625">625</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="afc79079a153c70240914617a9dde075d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#afc79079a153c70240914617a9dde075d">◆ </a></span>GetRequestMethod()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classHTTPRequest.html#a1afe92e9caad997b8f88f0cb07dcc5aa">HTTPRequest::RequestMethod</a> HTTPRequest::GetRequestMethod </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get request method. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00644">644</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a53a138e588e5326d6c87bb84029f43e9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a53a138e588e5326d6c87bb84029f43e9">◆ </a></span>GetURI()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::string HTTPRequest::GetURI </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get requested URI. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00639">639</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad0dc256f16fe6d13022958d64b7a22a0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad0dc256f16fe6d13022958d64b7a22a0">◆ </a></span>ReadBody()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::string HTTPRequest::ReadBody </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Read request body.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>As this consumes the underlying buffer, call this only once. Repeated calls will return an empty string. </dd></dl>
|
|
<p>Trivial implementation: if this is ever a performance bottleneck, internal copying can be avoided in multi-segment buffers by using evbuffer_peek and an awkward loop. Though in that case, it'd be even better to not copy into an intermediate string but use a stream abstraction to consume the evbuffer on the fly in the parsing algorithm.</p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00579">579</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>, and <a class="el" href="rest_8cpp_source.html#l00403">rest_getutxos()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a910ea3b361715e036dc74eb75e92fb62"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a910ea3b361715e036dc74eb75e92fb62">◆ </a></span>WriteHeader()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void HTTPRequest::WriteHeader </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>hdr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>value</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Write output header.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>call this before calling WriteErrorReply or Reply. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00599">599</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>, <a class="el" href="httprpc_8cpp_source.html#l00065">JSONErrorReply()</a>, <a class="el" href="rest_8cpp_source.html#l00203">rest_block()</a>, <a class="el" href="rest_8cpp_source.html#l00276">rest_chaininfo()</a>, <a class="el" href="rest_8cpp_source.html#l00403">rest_getutxos()</a>, <a class="el" href="rest_8cpp_source.html#l00129">rest_headers()</a>, <a class="el" href="rest_8cpp_source.html#l00326">rest_mempool_contents()</a>, <a class="el" href="rest_8cpp_source.html#l00301">rest_mempool_info()</a>, <a class="el" href="rest_8cpp_source.html#l00351">rest_tx()</a>, and <a class="el" href="rest_8cpp_source.html#l00068">RESTERR()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a43767ec5daf58e5a13a740ed56ddca3f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a43767ec5daf58e5a13a740ed56ddca3f">◆ </a></span>WriteReply()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void HTTPRequest::WriteReply </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>nStatus</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>strReply</em> = <code>""</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Write HTTP reply. nStatus is the HTTP status code to send. strReply is the body of the reply. Keep it empty to send a standard message.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>Can be called only once. As this will give the request back to the main thread, do not call any other <a class="el" href="classHTTPRequest.html">HTTPRequest</a> methods after calling this.</dd></dl>
|
|
<p>Closure sent to main thread to request a reply to be sent to a HTTP request. Replies must be sent in the main loop in the main http thread, this cannot be done from worker threads. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8cpp_source.html#l00611">611</a> of file <a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httprpc_8cpp_source.html#l00143">HTTPReq_JSONRPC()</a>, <a class="el" href="httprpc_8cpp_source.html#l00065">JSONErrorReply()</a>, <a class="el" href="rest_8cpp_source.html#l00203">rest_block()</a>, <a class="el" href="rest_8cpp_source.html#l00276">rest_chaininfo()</a>, <a class="el" href="rest_8cpp_source.html#l00403">rest_getutxos()</a>, <a class="el" href="rest_8cpp_source.html#l00129">rest_headers()</a>, <a class="el" href="rest_8cpp_source.html#l00326">rest_mempool_contents()</a>, <a class="el" href="rest_8cpp_source.html#l00301">rest_mempool_info()</a>, <a class="el" href="rest_8cpp_source.html#l00351">rest_tx()</a>, <a class="el" href="rest_8cpp_source.html#l00068">RESTERR()</a>, and <a class="el" href="httpserver_8cpp_source.html#l00558">~HTTPRequest()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Data Documentation</h2>
|
|
<a id="a1267b5e169b279bdbce5ea9c90f04483"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1267b5e169b279bdbce5ea9c90f04483">◆ </a></span>replySent</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool HTTPRequest::replySent</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8h_source.html#l00059">59</a> of file <a class="el" href="httpserver_8h_source.html">httpserver.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httpserver_8cpp_source.html#l00611">WriteReply()</a>, and <a class="el" href="httpserver_8cpp_source.html#l00558">~HTTPRequest()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa8b4243a4a15afaa00b3b47947fcfea3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa8b4243a4a15afaa00b3b47947fcfea3">◆ </a></span>req</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct evhttp_request* HTTPRequest::req</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="httpserver_8h_source.html#l00058">58</a> of file <a class="el" href="httpserver_8h_source.html">httpserver.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="httpserver_8cpp_source.html#l00568">GetHeader()</a>, <a class="el" href="httpserver_8cpp_source.html#l00625">GetPeer()</a>, <a class="el" href="httpserver_8cpp_source.html#l00644">GetRequestMethod()</a>, <a class="el" href="httpserver_8cpp_source.html#l00639">GetURI()</a>, <a class="el" href="httpserver_8cpp_source.html#l00579">ReadBody()</a>, <a class="el" href="httpserver_8cpp_source.html#l00599">WriteHeader()</a>, and <a class="el" href="httpserver_8cpp_source.html#l00611">WriteReply()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li>src/<a class="el" href="httpserver_8h_source.html">httpserver.h</a></li>
|
|
<li>src/<a class="el" href="httpserver_8cpp_source.html">httpserver.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="classHTTPRequest.html">HTTPRequest</a></li>
|
|
<li class="footer">Generated on Thu Dec 14 2017 13:15:13 for Dash Core by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|