31 #include <SFML/System/NonCopyable.hpp>
32 #include <SFML/Network/IPAddress.hpp>
33 #include <SFML/Network/SocketTCP.hpp>
76 Request(Method RequestMethod = Get,
const std::string& URI =
"/",
const std::string& Body =
"");
85 void SetField(
const std::string& Field,
const std::string& Value);
94 void SetMethod(Method RequestMethod);
103 void SetURI(
const std::string& URI);
113 void SetHttpVersion(
unsigned int Major,
unsigned int Minor);
123 void SetBody(
const std::string& Body);
135 std::string ToString()
const;
145 bool HasField(
const std::string& Field)
const;
150 typedef std::map<std::string, std::string> FieldTable;
158 unsigned int myMajorVersion;
159 unsigned int myMinorVersion;
185 MultipleChoices = 300,
186 MovedPermanently = 301,
187 MovedTemporarily = 302,
197 InternalServerError = 500,
198 NotImplemented = 501,
200 ServiceNotAvailable = 503,
203 InvalidResponse = 1000,
204 ConnectionFailed = 1001
221 const std::string& GetField(
const std::string& Field)
const;
229 Status GetStatus()
const;
237 unsigned int GetMajorHttpVersion()
const;
245 unsigned int GetMinorHttpVersion()
const;
257 const std::string& GetBody()
const;
269 void FromString(
const std::string& Data);
274 typedef std::map<std::string, std::string> FieldTable;
281 unsigned int myMajorVersion;
282 unsigned int myMinorVersion;
299 Http(
const std::string& Host,
unsigned short Port = 0);
308 void SetHost(
const std::string& Host,
unsigned short Port = 0);
324 Response SendRequest(
const Request& Req,
float Timeout = 0.f);
333 std::string myHostName;
334 unsigned short myPort;
340 #endif // SFML_HTTP_HPP