You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/browser/netutils/HTTPNetwork.hpp

36 lines
789 B
C++

//
// Created by koncord on 07.01.17.
//
#ifndef NEWLAUNCHER_HTTPNETWORK_HPP
#define NEWLAUNCHER_HTTPNETWORK_HPP
#include <string>
namespace RakNet
{
class TCPInterface;
class HTTPConnection2;
}
class HTTPNetwork
{
public:
HTTPNetwork(std::string addr, unsigned short port);
~HTTPNetwork();
std::string getData(const char *uri);
std::string getDataPOST(const char *uri, const char* body, const char* contentType = "application/json");
std::string getDataPUT(const char *uri, const char* body, const char* contentType = "application/json");
protected:
RakNet::TCPInterface *tcpInterface;
RakNet::HTTPConnection2 *httpConnection;
std::string address;
unsigned short port;
std::string answer();
};
#endif //NEWLAUNCHER_HTTPNETWORK_HPP