72 lines
36 KiB
HTML
72 lines
36 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>
|
|
<title>SFML - Simple and Fast Multimedia Library</title>
|
|
<meta http-equiv="Content-Type" content="text/html;"/>
|
|
<meta charset="utf-8"/>
|
|
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
|
|
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">SFML 2.5.1</span>
|
|
</div>
|
|
</div>
|
|
<div id="content">
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related 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><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
|
</ul>
|
|
</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_c0a853e81d6f1c1f0a3eb7a27dc24256.html">SFML</a></li><li class="navelem"><a class="el" href="dir_89e9fb32471ae291b179a889144513db.html">Network</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Http.hpp</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SFML - Simple and Fast Multimedia Library</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// This software is provided 'as-is', without any express or implied warranty.</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// subject to the following restrictions:</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">//</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// 1. The origin of this software must not be misrepresented;</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// you must not claim that you wrote the original software.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// If you use this software in a product, an acknowledgment</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// in the product documentation would be appreciated but is not required.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// and must not be misrepresented as being the original software.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">//</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">//</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#ifndef SFML_HTTP_HPP</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#define SFML_HTTP_HPP</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// Headers</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"></span><span class="preprocessor">#include <SFML/Network/Export.hpp></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <SFML/Network/IpAddress.hpp></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <SFML/Network/TcpSocket.hpp></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <SFML/System/NonCopyable.hpp></span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <SFML/System/Time.hpp></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include <map></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include <string></span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </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">namespace </span><a class="code" href="namespacesf.html">sf</a></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> {</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classsf_1_1Http.html"> 46</a></span> <span class="keyword">class </span>SFML_NETWORK_API <a class="code" href="classsf_1_1Http.html">Http</a> : <a class="code" href="classsf_1_1NonCopyable.html">NonCopyable</a></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html"> 54</a></span>  <span class="keyword">class </span>SFML_NETWORK_API <a class="code" href="classsf_1_1Http_1_1Request.html">Request</a></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598"> 62</a></span>  <span class="keyword">enum</span> <a class="code" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  {</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4"> 64</a></span>  <a class="code" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4">Get</a>, </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a"> 65</a></span>  <a class="code" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a">Post</a>, </div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b"> 66</a></span>  <a class="code" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b">Head</a>, </div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495"> 67</a></span>  <a class="code" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495">Put</a>, </div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598abc9555b94c1b896185015ec3990999f9"> 68</a></span>  Delete </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  };</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classsf_1_1Http_1_1Request.html">Request</a>(<span class="keyword">const</span> std::string& uri = <span class="stringliteral">"/"</span>, Method method = Get, <span class="keyword">const</span> std::string& body = <span class="stringliteral">""</span>);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordtype">void</span> setField(<span class="keyword">const</span> std::string& field, <span class="keyword">const</span> std::string& value);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordtype">void</span> setMethod(Method method);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordtype">void</span> setUri(<span class="keyword">const</span> std::string& uri);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordtype">void</span> setHttpVersion(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> major, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> minor);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordtype">void</span> setBody(<span class="keyword">const</span> std::string& body);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classsf_1_1Http.html">Http</a>;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  std::string prepare() <span class="keyword">const</span>;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">bool</span> hasField(<span class="keyword">const</span> std::string& field) <span class="keyword">const</span>;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> </div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="comment">// Types</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="comment"></span> <span class="keyword">typedef</span> std::map<std::string, std::string> FieldTable;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">// Member data</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="comment"></span> FieldTable m_fields; </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  Method m_method; </div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  std::string m_uri; </div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_majorVersion; </div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_minorVersion; </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  std::string m_body; </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  };</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> </div><div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html"> 193</a></span>  <span class="keyword">class </span>SFML_NETWORK_API <a class="code" href="classsf_1_1Http_1_1Response.html">Response</a></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  {</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> </div><div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8"> 201</a></span>  <span class="keyword">enum</span> <a class="code" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8">Status</a></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="comment">// 2xx: success</span></div><div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a0158f932254d3f09647dd1f64bd43832"> 204</a></span>  Ok = 200, </div><div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a0a6e8bafa9365a0ed10b8a9cbfd0649b"> 205</a></span>  Created = 201, </div><div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8ad328945457bd2f0d65107ba6b5ccd443"> 206</a></span>  Accepted = 202, </div><div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8aefde9e4abf5682dcd314d63143be42e0"> 207</a></span>  NoContent = 204, </div><div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a77327cc2a5e34cc64030b322e61d12a8"> 208</a></span>  ResetContent = 205, </div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a0cfae3ab0469b73dfddc54312a5e6a8a"> 209</a></span>  PartialContent = 206, </div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="comment">// 3xx: redirection</span></div><div class="line"><a name="l00212"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8add95cbd8fa27516821f763488557f96b"> 212</a></span>  MultipleChoices = 300, </div><div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a2f91651db3a09628faf68cbcefa0810a"> 213</a></span>  MovedPermanently = 301, </div><div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a05c50d7b17c844e0b909e5802d5f1587"> 214</a></span>  MovedTemporarily = 302, </div><div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a060ebc3af266e6bfe045b89e298e2545"> 215</a></span>  NotModified = 304, </div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="comment">// 4xx: client error</span></div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a3f88a714cf5483ee22f9051e5a3c080a"> 218</a></span>  BadRequest = 400, </div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8ab7a79b7bff50fb1902c19eecbb4e2a2d"> 219</a></span>  Unauthorized = 401, </div><div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a64492842e823ebe12a85539b6b454986"> 220</a></span>  Forbidden = 403, </div><div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8affca8a8319a62d98bd3ef90ff5cfc030"> 221</a></span>  NotFound = 404, </div><div class="line"><a name="l00222"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a12533d00093b190e6d4c0076577e2239"> 222</a></span>  RangeNotSatisfiable = 407, </div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="comment">// 5xx: server error</span></div><div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8adae2b2a936414349d55b4ed8c583fed1"> 225</a></span>  InternalServerError = 500, </div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a6920ba06d7e2bcf0b325da23ee95ef68"> 226</a></span>  NotImplemented = 501, </div><div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8aad0cbad4cdaf448beb763e86bc1f747c"> 227</a></span>  BadGateway = 502, </div><div class="line"><a name="l00228"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8ac4fffba9d5ad4c14171a1bbe4f6adf87"> 228</a></span>  ServiceNotAvailable = 503, </div><div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a215935d823ab44694709a184a71353b0"> 229</a></span>  GatewayTimeout = 504, </div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8aeb32a1a087d5fcf1a42663eb40c3c305"> 230</a></span>  VersionNotSupported = 505, </div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="comment">// 10xx: SFML custom codes</span></div><div class="line"><a name="l00233"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a0af0090420e60bf54da4860749345c95"> 233</a></span>  InvalidResponse = 1000, </div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8a7f307376f13bdc06b24fc274ecd2aa60"> 234</a></span>  ConnectionFailed = 1001 </div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  };</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> </div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="code" href="classsf_1_1Http_1_1Response.html">Response</a>();</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keyword">const</span> std::string& getField(<span class="keyword">const</span> std::string& field) <span class="keyword">const</span>;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> </div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  Status getStatus() <span class="keyword">const</span>;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span> </div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getMajorHttpVersion() <span class="keyword">const</span>;</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span> </div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getMinorHttpVersion() <span class="keyword">const</span>;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> </div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="keyword">const</span> std::string& getBody() <span class="keyword">const</span>;</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span> </div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classsf_1_1Http.html">Http</a>;</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> </div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordtype">void</span> parse(<span class="keyword">const</span> std::string& data);</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span> </div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span> </div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keywordtype">void</span> parseFields(std::istream &in);</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span> </div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="comment">// Types</span></div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span> <span class="comment"></span> <span class="keyword">typedef</span> std::map<std::string, std::string> FieldTable;</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span> </div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="comment">// Member data</span></div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span> <span class="comment"></span> FieldTable m_fields; </div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  Status m_status; </div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_majorVersion; </div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_minorVersion; </div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  std::string m_body; </div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  };</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span> </div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <a class="code" href="classsf_1_1Http.html">Http</a>();</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span> </div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <a class="code" href="classsf_1_1Http.html">Http</a>(<span class="keyword">const</span> std::string& host, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port = 0);</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span> </div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="keywordtype">void</span> setHost(<span class="keyword">const</span> std::string& host, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port = 0);</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span> </div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  Response sendRequest(<span class="keyword">const</span> Request& request, <a class="code" href="classsf_1_1Time.html">Time</a> timeout = <a class="code" href="classsf_1_1Time.html#a8db127b632fa8da21550e7282af11fa0">Time::Zero</a>);</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span> </div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span> </div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="comment">// Member data</span></div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span> <span class="comment"></span> <a class="code" href="classsf_1_1TcpSocket.html">TcpSocket</a> m_connection; </div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <a class="code" href="classsf_1_1IpAddress.html">IpAddress</a> m_host; </div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  std::string m_hostName; </div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> m_port; </div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span> };</div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span> </div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> } <span class="comment">// namespace sf</span></div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span> </div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span> </div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span> <span class="preprocessor">#endif // SFML_HTTP_HPP</span></div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span> </div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span> </div><div class="ttc" id="classsf_1_1Http_1_1Request_html_a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495">sf::Http::Request::Put</a></div><div class="ttdoc">Request in put mode, useful for a REST API. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00067">Http.hpp:67</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_html"><div class="ttname"><a href="classsf_1_1Http.html">sf::Http</a></div><div class="ttdoc">A HTTP client. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00046">Http.hpp:46</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Request_html"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html">sf::Http::Request</a></div><div class="ttdoc">Define a HTTP request. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00054">Http.hpp:54</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Response_html"><div class="ttname"><a href="classsf_1_1Http_1_1Response.html">sf::Http::Response</a></div><div class="ttdoc">Define a HTTP response. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00193">Http.hpp:193</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Time_html"><div class="ttname"><a href="classsf_1_1Time.html">sf::Time</a></div><div class="ttdoc">Represents a time value. </div><div class="ttdef"><b>Definition:</b> <a href="Time_8hpp_source.html#l00040">Time.hpp:40</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Time_html_a8db127b632fa8da21550e7282af11fa0"><div class="ttname"><a href="classsf_1_1Time.html#a8db127b632fa8da21550e7282af11fa0">sf::Time::Zero</a></div><div class="ttdeci">static const Time Zero</div><div class="ttdoc">Predefined "zero" time value. </div><div class="ttdef"><b>Definition:</b> <a href="Time_8hpp_source.html#l00085">Time.hpp:85</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Request_html_a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4">sf::Http::Request::Get</a></div><div class="ttdoc">Request in get mode, standard method to retrieve a page. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00064">Http.hpp:64</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Response_html_a663e071978e30fbbeb20ed045be874d8"><div class="ttname"><a href="classsf_1_1Http_1_1Response.html#a663e071978e30fbbeb20ed045be874d8">sf::Http::Response::Status</a></div><div class="ttdeci">Status</div><div class="ttdoc">Enumerate all the valid status codes for a response. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00201">Http.hpp:201</a></div></div>
|
|
<div class="ttc" id="classsf_1_1IpAddress_html"><div class="ttname"><a href="classsf_1_1IpAddress.html">sf::IpAddress</a></div><div class="ttdoc">Encapsulate an IPv4 network address. </div><div class="ttdef"><b>Definition:</b> <a href="IpAddress_8hpp_source.html#l00044">IpAddress.hpp:44</a></div></div>
|
|
<div class="ttc" id="classsf_1_1NonCopyable_html"><div class="ttname"><a href="classsf_1_1NonCopyable.html">sf::NonCopyable</a></div><div class="ttdoc">Utility class that makes any derived class non-copyable. </div><div class="ttdef"><b>Definition:</b> <a href="NonCopyable_8hpp_source.html#l00041">NonCopyable.hpp:41</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Request_html_a620f8bff6f43e1378f321bf53fbf5598"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">sf::Http::Request::Method</a></div><div class="ttdeci">Method</div><div class="ttdoc">Enumerate the available HTTP methods for a request. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00062">Http.hpp:62</a></div></div>
|
|
<div class="ttc" id="classsf_1_1TcpSocket_html"><div class="ttname"><a href="classsf_1_1TcpSocket.html">sf::TcpSocket</a></div><div class="ttdoc">Specialized socket using the TCP protocol. </div><div class="ttdef"><b>Definition:</b> <a href="TcpSocket_8hpp_source.html#l00046">TcpSocket.hpp:46</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Request_html_a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b">sf::Http::Request::Head</a></div><div class="ttdoc">Request a page&#39;s header only. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00066">Http.hpp:66</a></div></div>
|
|
<div class="ttc" id="namespacesf_html"><div class="ttname"><a href="namespacesf.html">sf</a></div><div class="ttdef"><b>Definition:</b> <a href="AlResource_8hpp_source.html#l00034">AlResource.hpp:34</a></div></div>
|
|
<div class="ttc" id="classsf_1_1Http_1_1Request_html_a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a"><div class="ttname"><a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a">sf::Http::Request::Post</a></div><div class="ttdoc">Request in post mode, usually to send data to a page. </div><div class="ttdef"><b>Definition:</b> <a href="Http_8hpp_source.html#l00065">Http.hpp:65</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
|
|
Copyright © Laurent Gomila ::
|
|
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|