_base_http_handler_8h_source.html
20.4 KB
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
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>hueplusplus: include/hueplusplus/BaseHttpHandler.h Source File</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="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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">hueplusplus
 <span id="projectnumber">1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e05b4b7707bd5f9fd045e8be02b17d0a.html">hueplusplus</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">BaseHttpHandler.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_base_http_handler_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#ifndef INCLUDE_HUEPLUSPLUS_BASE_HTTP_HANDLER_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#define INCLUDE_HUEPLUSPLUS_BASE_HTTP_HANDLER_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <iostream></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <memory></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <string></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <vector></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="_i_http_handler_8h.html">IHttpHandler.h</a>"</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "json/json.hpp"</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">namespace </span><a class="code" href="namespacehueplusplus.html">hueplusplus</a></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classhueplusplus_1_1_base_http_handler.html"> 38</a></span> <span class="keyword">class </span><a class="code" href="classhueplusplus_1_1_base_http_handler.html">BaseHttpHandler</a> : <span class="keyword">public</span> <a class="code" href="classhueplusplus_1_1_i_http_handler.html">IHttpHandler</a></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">virtual</span> <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a0e1250a1537f7e7f05cab75af4b9c82f">~BaseHttpHandler</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#ad5f51b25770345641c871f6efbc579aa">sendGetHTTPBody</a>(<span class="keyword">const</span> std::string& msg, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a8a10fabfc57e4c60612bc279fae25050">sendHTTPRequest</a>(<span class="keyword">const</span> std::string& method, <span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> std::string& contentType,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keyword">const</span> std::string& body, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a601f2e4dfec195a094e30c2f22263cf9">GETString</a>(<span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> std::string& contentType, <span class="keyword">const</span> std::string& body,</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a896da865ceb520bd9797948395fa203d">POSTString</a>(<span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> std::string& contentType, <span class="keyword">const</span> std::string& body,</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a72f4a78eea5c4b1c8f23b074ee3648bf">PUTString</a>(<span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> std::string& contentType, <span class="keyword">const</span> std::string& body,</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  std::string <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a139cbb13a19d3f12b8242bbe7e18b850">DELETEString</a>(<span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> std::string& contentType, <span class="keyword">const</span> std::string& body,</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  nlohmann::json <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a059678ec7136be20fc5e8ca242929fe9">GETJson</a>(</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> nlohmann::json& body, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  nlohmann::json <a class="code" href="classhueplusplus_1_1_base_http_handler.html#ad43b42bf599a59fdd89a4195ec891a02">POSTJson</a>(</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> nlohmann::json& body, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  nlohmann::json <a class="code" href="classhueplusplus_1_1_base_http_handler.html#a602b5ea73d5788e2bb79a654906e5de0">PUTJson</a>(</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> nlohmann::json& body, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  nlohmann::json <a class="code" href="classhueplusplus_1_1_base_http_handler.html#abf5e5d6c49851f3a10c6b6378b835226">DELETEJson</a>(</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keyword">const</span> std::string& uri, <span class="keyword">const</span> nlohmann::json& body, <span class="keyword">const</span> std::string& adr, <span class="keywordtype">int</span> port = 80) <span class="keyword">const override</span>;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> };</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> } <span class="comment">// namespace hueplusplus</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a139cbb13a19d3f12b8242bbe7e18b850"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a139cbb13a19d3f12b8242bbe7e18b850">hueplusplus::BaseHttpHandler::DELETEString</a></div><div class="ttdeci">std::string DELETEString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP DELETE request to the specified host and return the body of the response. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:97</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a0e1250a1537f7e7f05cab75af4b9c82f"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a0e1250a1537f7e7f05cab75af4b9c82f">hueplusplus::BaseHttpHandler::~BaseHttpHandler</a></div><div class="ttdeci">virtual ~BaseHttpHandler()=default</div><div class="ttdoc">Virtual dtor. </div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a896da865ceb520bd9797948395fa203d"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a896da865ceb520bd9797948395fa203d">hueplusplus::BaseHttpHandler::POSTString</a></div><div class="ttdeci">std::string POSTString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP POST request to the specified host and return the body of the response. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:85</div></div>
<div class="ttc" id="namespacehueplusplus_html"><div class="ttname"><a href="namespacehueplusplus.html">hueplusplus</a></div><div class="ttdoc">Namespace for the hueplusplus library. </div><div class="ttdef"><b>Definition:</b> Action.h:27</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_ad43b42bf599a59fdd89a4195ec891a02"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#ad43b42bf599a59fdd89a4195ec891a02">hueplusplus::BaseHttpHandler::POSTJson</a></div><div class="ttdeci">nlohmann::json POSTJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP POST request to the specified host and return the body of the response parsed as JSON...</div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:109</div></div>
<div class="ttc" id="classhueplusplus_1_1_i_http_handler_html"><div class="ttname"><a href="classhueplusplus_1_1_i_http_handler.html">hueplusplus::IHttpHandler</a></div><div class="ttdoc">Abstract class for classes that handle http requests and multicast requests. </div><div class="ttdef"><b>Definition:</b> IHttpHandler.h:37</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a059678ec7136be20fc5e8ca242929fe9"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a059678ec7136be20fc5e8ca242929fe9">hueplusplus::BaseHttpHandler::GETJson</a></div><div class="ttdeci">nlohmann::json GETJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP GET request to the specified host and return the body of the response parsed as JSON...</div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:103</div></div>
<div class="ttc" id="_i_http_handler_8h_html"><div class="ttname"><a href="_i_http_handler_8h.html">IHttpHandler.h</a></div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a601f2e4dfec195a094e30c2f22263cf9"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a601f2e4dfec195a094e30c2f22263cf9">hueplusplus::BaseHttpHandler::GETString</a></div><div class="ttdeci">std::string GETString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP GET request to the specified host and return the body of the response. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:79</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a602b5ea73d5788e2bb79a654906e5de0"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a602b5ea73d5788e2bb79a654906e5de0">hueplusplus::BaseHttpHandler::PUTJson</a></div><div class="ttdeci">nlohmann::json PUTJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP PUT request to the specified host and return the body of the response parsed as JSON...</div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:115</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a8a10fabfc57e4c60612bc279fae25050"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a8a10fabfc57e4c60612bc279fae25050">hueplusplus::BaseHttpHandler::sendHTTPRequest</a></div><div class="ttdeci">std::string sendHTTPRequest(const std::string &method, const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP request with the given method to the specified host and return the body of the response...</div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:46</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_ad5f51b25770345641c871f6efbc579aa"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#ad5f51b25770345641c871f6efbc579aa">hueplusplus::BaseHttpHandler::sendGetHTTPBody</a></div><div class="ttdeci">std::string sendGetHTTPBody(const std::string &msg, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a message to a specified host and return the body of the response. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:29</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_abf5e5d6c49851f3a10c6b6378b835226"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#abf5e5d6c49851f3a10c6b6378b835226">hueplusplus::BaseHttpHandler::DELETEJson</a></div><div class="ttdeci">nlohmann::json DELETEJson(const std::string &uri, const nlohmann::json &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP DELETE request to the specified host and return the body of the response parsed as JSON...</div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:121</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html_a72f4a78eea5c4b1c8f23b074ee3648bf"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html#a72f4a78eea5c4b1c8f23b074ee3648bf">hueplusplus::BaseHttpHandler::PUTString</a></div><div class="ttdeci">std::string PUTString(const std::string &uri, const std::string &contentType, const std::string &body, const std::string &adr, int port=80) const override</div><div class="ttdoc">Send a HTTP PUT request to the specified host and return the body of the response. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.cpp:91</div></div>
<div class="ttc" id="classhueplusplus_1_1_base_http_handler_html"><div class="ttname"><a href="classhueplusplus_1_1_base_http_handler.html">hueplusplus::BaseHttpHandler</a></div><div class="ttdoc">Base class for classes that handle http requests and multicast requests. </div><div class="ttdef"><b>Definition:</b> BaseHttpHandler.h:38</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>