#include <HTTPConnection.h>
Public Types | ||||
enum | ResponseCodes | |||
Public Member Functions | ||||
HTTPConnection (TCPInterface &tcp, const char *host, unsigned short port=80) | ||||
void | Post (const char *path, const char *data, const char *_contentType="application/x-www-form-urlencoded") | |||
| ||||
RakNet::RakString | Read (void) | |||
void | Update (void) | |||
Call periodically to do time-based updates. | ||||
SystemAddress | GetServerAddress (void) const | |||
Returns the address of the server we are connected to. | ||||
bool | ProcessFinalTCPPacket (Packet *packet) | |||
| ||||
bool | HasBadResponse (int *code, RakNet::RakString *data) | |||
Queued events of failed exchanges with the HTTP server. | ||||
bool | IsBusy (void) const | |||
Returns false if the connection is not doing anything else. | ||||
Classes | ||||
struct | BadResponse | |||
Encapsulates a raw HTTP response and response code. More... |
Note that only one Post() can be handled at a time.
Results of HTTP requests. Standard response codes are < 999 ( define HTTP codes and our internal codes as needed )
HTTPConnection::HTTPConnection | ( | TCPInterface & | tcp, | |
const char * | host, | |||
unsigned short | port = 80 | |||
) |
Returns a HTTP object associated with this tcp connection
void HTTPConnection::Post | ( | const char * | path, | |
const char * | data, | |||
const char * | _contentType = "application/x-www-form-urlencoded" | |||
) |
contentType | "Content-Type:" passed to post. |
path | the path on the remote server you want to POST to. For example "mywebpage/index.html" | |
data | A NULL terminated string to submit to the server |
RakString HTTPConnection::Read | ( | void | ) |
Get data returned by the HTTP server If IsFinished()==false then this may be empty or a partial response.
bool HTTPConnection::ProcessFinalTCPPacket | ( | Packet * | packet | ) |
packet | NULL or a packet associated with our host and port |