PixelLightAPI
.
|
#include <HttpClient.h>
Public Member Functions | |
PLCORE_API | HttpClient () |
Constructor. | |
virtual PLCORE_API | ~HttpClient () |
Destructor. | |
EClientSignature | GetClientSignature () const |
Get client signature. | |
void | SetClientSignature (EClientSignature nClientSignature) |
Set client signature. | |
EHttpProtocol | GetProtocol () const |
Get protocol version. | |
void | SetProtocol (EHttpProtocol nProtocol) |
Set protocol version. | |
EHttpConnection | GetConnectionType () const |
Get connection type. | |
void | SetConnectionType (EHttpConnection nConnection) |
Set connection type. | |
EHttpAuth | GetAuthentication () const |
Get authentication. | |
void | SetAuthentication (EHttpAuth nAuth, const String &sUsername, const String &sPassword) |
Set authentication. | |
bool | IsConnected () const |
Check if a connection is open. | |
PLCORE_API bool | Open (const String &sAddress, uint32 nPort=80) |
Open connection to server. | |
PLCORE_API void | Disconnect () |
Close HTTP session. | |
PLCORE_API bool | Get (const String &sURL) |
Open a HTTP resource (GET command) | |
PLCORE_API bool | GetPartial (const String &sURL, uint32 nPos, int32 nSize=-1) |
Open a HTTP resource and get partial data (GET command) | |
PLCORE_API bool | Post (const String &sURL, const String &sPostData) |
Open a HTTP resource (POST command) | |
PLCORE_API bool | Delete (const String &sURL) |
Delete a HTTP resource (DELETE command) | |
const HttpHeader & | GetHeader () const |
Get HTTP header sent from server. | |
PLCORE_API int | Read (char *pBuffer, uint32 nSize) |
Read data from HTTP connection. | |
Protected Member Functions | |
virtual PLCORE_API Connection * | CreateOutgoingConnection () override |
Create a new outgoing connection. | |
virtual PLCORE_API void | OnDisconnect (Connection &cConnection) override |
Called when a connection is closed. |
Http server.
PLCORE_API PLCore::HttpClient::HttpClient | ( | ) |
virtual PLCORE_API PLCore::HttpClient::~HttpClient | ( | ) | [virtual] |
Destructor.
EClientSignature PLCore::HttpClient::GetClientSignature | ( | ) | const [inline] |
Get client signature.
void PLCore::HttpClient::SetClientSignature | ( | EClientSignature | nClientSignature | ) | [inline] |
Set client signature.
[in] | nClientSignature | Client signature |
EHttpProtocol PLCore::HttpClient::GetProtocol | ( | ) | const [inline] |
Get protocol version.
void PLCore::HttpClient::SetProtocol | ( | EHttpProtocol | nProtocol | ) | [inline] |
Set protocol version.
[in] | nProtocol | HTTP protocol version |
EHttpConnection PLCore::HttpClient::GetConnectionType | ( | ) | const [inline] |
Get connection type.
void PLCore::HttpClient::SetConnectionType | ( | EHttpConnection | nConnection | ) | [inline] |
Set connection type.
[in] | nConnection | HTTP connection type |
EHttpAuth PLCore::HttpClient::GetAuthentication | ( | ) | const [inline] |
Get authentication.
void PLCore::HttpClient::SetAuthentication | ( | EHttpAuth | nAuth, |
const String & | sUsername, | ||
const String & | sPassword | ||
) | [inline] |
Set authentication.
[in] | nAuth | HTTP authentication type |
[in] | sUsername | User name |
[in] | sPassword | Password |
bool PLCore::HttpClient::IsConnected | ( | ) | const [inline] |
Check if a connection is open.
PLCORE_API bool PLCore::HttpClient::Open | ( | const String & | sAddress, |
uint32 | nPort = 80 |
||
) |
Open connection to server.
[in] | sAddress | Server address |
[in] | nPort | Port number (Default: 80) |
PLCORE_API void PLCore::HttpClient::Disconnect | ( | ) |
Close HTTP session.
PLCORE_API bool PLCore::HttpClient::Get | ( | const String & | sURL | ) |
Open a HTTP resource (GET command)
[in] | sURL | URL |
PLCORE_API bool PLCore::HttpClient::GetPartial | ( | const String & | sURL, |
uint32 | nPos, | ||
int32 | nSize = -1 |
||
) |
Open a HTTP resource and get partial data (GET command)
[in] | sURL | URL |
[in] | nPos | Start offset |
[in] | nSize | Size of data to read (-1 for all) |
PLCORE_API bool PLCore::HttpClient::Post | ( | const String & | sURL, |
const String & | sPostData | ||
) |
Open a HTTP resource (POST command)
[in] | sURL | URL |
[in] | sPostData | Additional data for POST command |
PLCORE_API bool PLCore::HttpClient::Delete | ( | const String & | sURL | ) |
Delete a HTTP resource (DELETE command)
[in] | sURL | URL |
const HttpHeader & PLCore::HttpClient::GetHeader | ( | ) | const [inline] |
Get HTTP header sent from server.
PLCORE_API int PLCore::HttpClient::Read | ( | char * | pBuffer, |
uint32 | nSize | ||
) |
Read data from HTTP connection.
[in] | pBuffer | Data buffer |
[in] | nSize | Size in bytes |
virtual PLCORE_API Connection* PLCore::HttpClient::CreateOutgoingConnection | ( | ) | [override, protected, virtual] |
virtual PLCORE_API void PLCore::HttpClient::OnDisconnect | ( | Connection & | cConnection | ) | [override, protected, virtual] |
Called when a connection is closed.
[in] | cConnection | The closed connection |
Reimplemented from PLCore::Host.
|