31 #include <SFML/Network/Export.hpp>
32 #include <SFML/Network/IpAddress.hpp>
33 #include <SFML/Network/TcpSocket.hpp>
34 #include <SFML/System/NonCopyable.hpp>
35 #include <SFML/System/Time.hpp>
80 Request(
const std::string& uri =
"/", Method method = Get,
const std::string& body =
"");
95 void setField(
const std::string& field,
const std::string& value);
107 void setMethod(Method method);
119 void setUri(
const std::string& uri);
130 void setHttpVersion(
unsigned int major,
unsigned int minor);
142 void setBody(
const std::string& body);
157 std::string prepare()
const;
169 bool hasField(
const std::string& field)
const;
174 typedef std::map<std::string, std::string> FieldTable;
182 unsigned int m_majorVersion;
183 unsigned int m_minorVersion;
207 PartialContent = 206,
210 MultipleChoices = 300,
211 MovedPermanently = 301,
212 MovedTemporarily = 302,
220 RangeNotSatisfiable = 407,
223 InternalServerError = 500,
224 NotImplemented = 501,
226 ServiceNotAvailable = 503,
227 GatewayTimeout = 504,
228 VersionNotSupported = 505,
231 InvalidResponse = 1000,
232 ConnectionFailed = 1001
255 const std::string& getField(
const std::string& field)
const;
268 Status getStatus()
const;
278 unsigned int getMajorHttpVersion()
const;
288 unsigned int getMinorHttpVersion()
const;
302 const std::string& getBody()
const;
317 void parse(
const std::string& data);
322 typedef std::map<std::string, std::string> FieldTable;
329 unsigned int m_majorVersion;
330 unsigned int m_minorVersion;
354 Http(
const std::string& host,
unsigned short port = 0);
371 void setHost(
const std::string& host,
unsigned short port = 0);
391 Response sendRequest(
const Request& request,
Time timeout =
Time::Zero);
400 std::string m_hostName;
401 unsigned short m_port;
407 #endif // SFML_HTTP_HPP