353 lines
19 KiB
HTML
353 lines
19 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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Http.html">Http</a></li><li class="navelem"><a class="el" href="classsf_1_1Http_1_1Request.html">Request</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#friends">Friends</a> |
|
|
<a href="classsf_1_1Http_1_1Request-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">sf::Http::Request Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Define a HTTP request.
|
|
<a href="classsf_1_1Http_1_1Request.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Http_8hpp_source.html">Http.hpp</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:a620f8bff6f43e1378f321bf53fbf5598"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a> { <br />
|
|
  <a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4">Get</a>,
|
|
<a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a">Post</a>,
|
|
<a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b">Head</a>,
|
|
<a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495">Put</a>,
|
|
<br />
|
|
  <a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598abc9555b94c1b896185015ec3990999f9">Delete</a>
|
|
<br />
|
|
}</td></tr>
|
|
<tr class="memdesc:a620f8bff6f43e1378f321bf53fbf5598"><td class="mdescLeft"> </td><td class="mdescRight">Enumerate the available HTTP methods for a request. <a href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">More...</a><br /></td></tr>
|
|
<tr class="separator:a620f8bff6f43e1378f321bf53fbf5598"><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:a8e89d9e8ffcc1163259b35d79809a61c"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#a8e89d9e8ffcc1163259b35d79809a61c">Request</a> (const std::string &uri="/", <a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a> method=<a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4">Get</a>, const std::string &body="")</td></tr>
|
|
<tr class="memdesc:a8e89d9e8ffcc1163259b35d79809a61c"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a8e89d9e8ffcc1163259b35d79809a61c">More...</a><br /></td></tr>
|
|
<tr class="separator:a8e89d9e8ffcc1163259b35d79809a61c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aea672fae5dd089f4b6b3745ed46210d2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#aea672fae5dd089f4b6b3745ed46210d2">setField</a> (const std::string &field, const std::string &value)</td></tr>
|
|
<tr class="memdesc:aea672fae5dd089f4b6b3745ed46210d2"><td class="mdescLeft"> </td><td class="mdescRight">Set the value of a field. <a href="#aea672fae5dd089f4b6b3745ed46210d2">More...</a><br /></td></tr>
|
|
<tr class="separator:aea672fae5dd089f4b6b3745ed46210d2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:abab148554e873e80d2e41376fde1cb62"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#abab148554e873e80d2e41376fde1cb62">setMethod</a> (<a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a> method)</td></tr>
|
|
<tr class="memdesc:abab148554e873e80d2e41376fde1cb62"><td class="mdescLeft"> </td><td class="mdescRight">Set the request method. <a href="#abab148554e873e80d2e41376fde1cb62">More...</a><br /></td></tr>
|
|
<tr class="separator:abab148554e873e80d2e41376fde1cb62"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3723de4b4f1a14b744477841c4ac22e6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#a3723de4b4f1a14b744477841c4ac22e6">setUri</a> (const std::string &uri)</td></tr>
|
|
<tr class="memdesc:a3723de4b4f1a14b744477841c4ac22e6"><td class="mdescLeft"> </td><td class="mdescRight">Set the requested URI. <a href="#a3723de4b4f1a14b744477841c4ac22e6">More...</a><br /></td></tr>
|
|
<tr class="separator:a3723de4b4f1a14b744477841c4ac22e6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa683b607b737a6224a91387b4108d3c7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#aa683b607b737a6224a91387b4108d3c7">setHttpVersion</a> (unsigned int major, unsigned int minor)</td></tr>
|
|
<tr class="memdesc:aa683b607b737a6224a91387b4108d3c7"><td class="mdescLeft"> </td><td class="mdescRight">Set the HTTP version for the request. <a href="#aa683b607b737a6224a91387b4108d3c7">More...</a><br /></td></tr>
|
|
<tr class="separator:aa683b607b737a6224a91387b4108d3c7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae9f61ec3fa1639c70e9b5780cb35578e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.html#ae9f61ec3fa1639c70e9b5780cb35578e">setBody</a> (const std::string &body)</td></tr>
|
|
<tr class="memdesc:ae9f61ec3fa1639c70e9b5780cb35578e"><td class="mdescLeft"> </td><td class="mdescRight">Set the body of the request. <a href="#ae9f61ec3fa1639c70e9b5780cb35578e">More...</a><br /></td></tr>
|
|
<tr class="separator:ae9f61ec3fa1639c70e9b5780cb35578e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
|
Friends</h2></td></tr>
|
|
<tr class="memitem:aba95e2a7762bb5df986048b05d03a22e"><td class="memItemLeft" align="right" valign="top"><a id="aba95e2a7762bb5df986048b05d03a22e"></a>
|
|
class </td><td class="memItemRight" valign="bottom"><b>Http</b></td></tr>
|
|
<tr class="separator:aba95e2a7762bb5df986048b05d03a22e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Define a HTTP request. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Http_8hpp_source.html#l00054">54</a> of file <a class="el" href="Http_8hpp_source.html">Http.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="a620f8bff6f43e1378f321bf53fbf5598"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a620f8bff6f43e1378f321bf53fbf5598">◆ </a></span>Method</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">sf::Http::Request::Method</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Enumerate the available HTTP methods for a request. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4"></a>Get </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Http_1_1Request.html" title="Define a HTTP request. ">Request</a> in get mode, standard method to retrieve a page. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a620f8bff6f43e1378f321bf53fbf5598ae8ec4048b9550f8d0747d4199603141a"></a>Post </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Http_1_1Request.html" title="Define a HTTP request. ">Request</a> in post mode, usually to send data to a page. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a620f8bff6f43e1378f321bf53fbf5598a4df23138be7ed60f47aba6548ba65e7b"></a>Head </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Http_1_1Request.html" title="Define a HTTP request. ">Request</a> a page's header only. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a620f8bff6f43e1378f321bf53fbf5598a523b94f9af069c1f35061d32011e2495"></a>Put </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Http_1_1Request.html" title="Define a HTTP request. ">Request</a> in put mode, useful for a REST API. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a620f8bff6f43e1378f321bf53fbf5598abc9555b94c1b896185015ec3990999f9"></a>Delete </td><td class="fielddoc"><p><a class="el" href="classsf_1_1Http_1_1Request.html" title="Define a HTTP request. ">Request</a> in delete mode, useful for a REST API. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Http_8hpp_source.html#l00062">62</a> of file <a class="el" href="Http_8hpp_source.html">Http.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a8e89d9e8ffcc1163259b35d79809a61c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8e89d9e8ffcc1163259b35d79809a61c">◆ </a></span>Request()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Http::Request::Request </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>uri</em> = <code>"/"</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a> </td>
|
|
<td class="paramname"><em>method</em> = <code><a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4">Get</a></code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>body</em> = <code>""</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Default constructor. </p>
|
|
<p>This constructor creates a GET request, with the root URI ("/") and an empty body.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">uri</td><td>Target URI </td></tr>
|
|
<tr><td class="paramname">method</td><td>Method to use for the request </td></tr>
|
|
<tr><td class="paramname">body</td><td>Content of the request's body </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ae9f61ec3fa1639c70e9b5780cb35578e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae9f61ec3fa1639c70e9b5780cb35578e">◆ </a></span>setBody()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Http::Request::setBody </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>body</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the body of the request. </p>
|
|
<p>The body of a request is optional and only makes sense for POST requests. It is ignored for all other methods. The body is empty by default.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">body</td><td>Content of the body </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aea672fae5dd089f4b6b3745ed46210d2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aea672fae5dd089f4b6b3745ed46210d2">◆ </a></span>setField()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Http::Request::setField </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>field</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>Set the value of a field. </p>
|
|
<p>The field is created if it doesn't exist. The name of the field is case-insensitive. By default, a request doesn't contain any field (but the mandatory fields are added later by the HTTP client when sending the request).</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">field</td><td>Name of the field to set </td></tr>
|
|
<tr><td class="paramname">value</td><td>Value of the field </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa683b607b737a6224a91387b4108d3c7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa683b607b737a6224a91387b4108d3c7">◆ </a></span>setHttpVersion()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Http::Request::setHttpVersion </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>major</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>minor</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the HTTP version for the request. </p>
|
|
<p>The HTTP version is 1.0 by default.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">major</td><td>Major HTTP version number </td></tr>
|
|
<tr><td class="paramname">minor</td><td>Minor HTTP version number </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="abab148554e873e80d2e41376fde1cb62"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#abab148554e873e80d2e41376fde1cb62">◆ </a></span>setMethod()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Http::Request::setMethod </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598">Method</a> </td>
|
|
<td class="paramname"><em>method</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the request method. </p>
|
|
<p>See the Method enumeration for a complete list of all the availale methods. The method is <a class="el" href="classsf_1_1Http_1_1Request.html#a620f8bff6f43e1378f321bf53fbf5598ab822baed393f3d0353621e5378b9fcb4" title="Request in get mode, standard method to retrieve a page. ">Http::Request::Get</a> by default.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">method</td><td>Method to use for the request </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3723de4b4f1a14b744477841c4ac22e6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3723de4b4f1a14b744477841c4ac22e6">◆ </a></span>setUri()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Http::Request::setUri </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>uri</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the requested URI. </p>
|
|
<p>The URI is the resource (usually a web page or a file) that you want to get or post. The URI is "/" (the root page) by default.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">uri</td><td>URI to request, relative to the host </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="Http_8hpp_source.html">Http.hpp</a></li>
|
|
</ul>
|
|
</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>
|