summaryrefslogtreecommitdiff
path: root/doc/html/classsf_1_1Http.htm
blob: ee10ea804d34a42f3c007dc7b6f2ad4dd2851c8b (plain)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="tabs.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div id="logo">
            <img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
        </div>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.htm"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.htm"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.htm"><span>Classes</span></a></li>
    <li><a href="files.htm"><span>Files</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.htm"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.htm"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.htm"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.htm"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespacesf.htm">sf</a>::<a class="el" href="classsf_1_1Http.htm">Http</a></div>
<h1>sf::Http Class Reference</h1><!-- doxytag: class="sf::Http" --><!-- doxytag: inherits="sf::NonCopyable" -->This class provides methods for manipulating the HTTP protocol (described in RFC 1945).  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="Http_8hpp-source.htm">Http.hpp</a>&gt;</code>
<p>
<p>Inheritance diagram for sf::Http:
<p><center><img src="classsf_1_1Http.png" usemap="#sf::Http_map" border="0" alt=""></center>
<map name="sf::Http_map">
<area href="structsf_1_1NonCopyable.htm" alt="sf::NonCopyable" shape="rect" coords="0,0,105,24">
</map>
<a href="classsf_1_1Http-members.htm">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http.htm#be2360194f99bdde402c9f97a85cf067">Http</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor.  <a href="#be2360194f99bdde402c9f97a85cf067"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http.htm#283ce40b04ef678916834b8032796677">Http</a> (const std::string &amp;Host, unsigned short Port=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct the <a class="el" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a> instance with the target host.  <a href="#283ce40b04ef678916834b8032796677"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http.htm#233fb3eabfeb22a442a0db92e38aee1f">SetHost</a> (const std::string &amp;Host, unsigned short Port=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the target host.  <a href="#233fb3eabfeb22a442a0db92e38aee1f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classsf_1_1Http_1_1Response.htm">Response</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http.htm#bfe7aebec9a2ef36e6489adf11e30e89">SendRequest</a> (const <a class="el" href="classsf_1_1Http_1_1Request.htm">Request</a> &amp;Req)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a HTTP request and return the server's response.  <a href="#bfe7aebec9a2ef36e6489adf11e30e89"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Request.htm">Request</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This class wraps an HTTP request, which is basically :<ul>
<li>a header with a method, a target URI, and a set of field/value pairs</li><li>an optional body (for POST requests). </li></ul>
 <a href="classsf_1_1Http_1_1Request.htm#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Http_1_1Response.htm">Response</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This class wraps an HTTP response, which is basically :<ul>
<li>a header with a status code and a set of field/value pairs</li><li>a body (the content of the requested resource). </li></ul>
 <a href="classsf_1_1Http_1_1Response.htm#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class provides methods for manipulating the HTTP protocol (described in RFC 1945). 
<p>
It can connect to a website, get its files, send requests, etc. 
<p>

<p>
Definition at line <a class="el" href="Http_8hpp-source.htm#l00045">45</a> of file <a class="el" href="Http_8hpp-source.htm">Http.hpp</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="be2360194f99bdde402c9f97a85cf067"></a><!-- doxytag: member="sf::Http::Http" ref="be2360194f99bdde402c9f97a85cf067" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Http::Http           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default constructor. 
<p>

</div>
</div><p>
<a class="anchor" name="283ce40b04ef678916834b8032796677"></a><!-- doxytag: member="sf::Http::Http" ref="283ce40b04ef678916834b8032796677" args="(const std::string &amp;Host, unsigned short Port=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Http::Http           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>Host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&nbsp;</td>
          <td class="paramname"> <em>Port</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct the <a class="el" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a> instance with the target host. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Host</em>&nbsp;</td><td>: Web server to connect to </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>Port</em>&nbsp;</td><td>: Port to use for connection (0 by default -- use the standard port of the protocol used) </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="233fb3eabfeb22a442a0db92e38aee1f"></a><!-- doxytag: member="sf::Http::SetHost" ref="233fb3eabfeb22a442a0db92e38aee1f" args="(const std::string &amp;Host, unsigned short Port=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Http::SetHost           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>Host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&nbsp;</td>
          <td class="paramname"> <em>Port</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the target host. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Host</em>&nbsp;</td><td>: Web server to connect to </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>Port</em>&nbsp;</td><td>: Port to use for connection (0 by default -- use the standard port of the protocol used) </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="bfe7aebec9a2ef36e6489adf11e30e89"></a><!-- doxytag: member="sf::Http::SendRequest" ref="bfe7aebec9a2ef36e6489adf11e30e89" args="(const Request &amp;Req)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Http_1_1Response.htm">Response</a> sf::Http::SendRequest           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1Http_1_1Request.htm">Request</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>Req</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Send a HTTP request and return the server's response. 
<p>
You must be connected to a host before sending requests. Any missing mandatory header field will be added with an appropriate value. Warning : this function waits for the server's response and may not return instantly; use a thread if you don't want to block your application.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Req</em>&nbsp;</td><td>: <a class="el" href="classsf_1_1Http_1_1Request.htm" title="This class wraps an HTTP request, which is basically :a header with a method, a target...">Request</a> to send</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Server's response </dd></dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Http_8hpp-source.htm">Http.hpp</a></ul>

        <p id="footer">
            &nbsp;::&nbsp; Copyright &copy; 2007-2008 Laurent Gomila, all rights reserved &nbsp;::&nbsp;
            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> &nbsp;::&nbsp;
        </p>

    </body>
</html>