Base Framework
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
HTTPSRequest Class Reference

#include <base/net/HTTPSRequest.h>

Inherits Resource.

Public Member Functions

 HTTPSRequest ()
 
bool open (const String &method, const String &url, const String &user=String(), const String &password=String())
 
void setRequestHeader (const String &header)
 
void setRequestHeader (const String &name, const String &value)
 
void setAgent (const String &agent)
 
void send (const String &body=String())
 
void close ()
 
unsigned int getStatus ()
 
String getStatusText ()
 
uint64 getContentLength ()
 
String getResponseHeader (const String &name)
 
String getResponseHeader ()
 
String getResponse ()
 
void getResponse (OutputStream *os)
 
void getResponse (PushInterface *pi)
 
- Public Member Functions inherited from Resource
String getDescription () const
 
void setDescription (const String &description)
 
unsigned int getResourceId () const
 
unsigned int getCreatedById () const
 
AnyReference getHandle () const noexcept
 
template<class TYPE >
TYPE & getInternalHandle () const
 
 operator bool () const noexcept
 

Static Public Member Functions

static bool isSupported () noexcept
 
static StringPair load (const String &url, const String &method=METHOD_GET, const String &body=String())
 

Static Public Attributes

static const char * METHOD_GET
 
static const char * METHOD_POST
 
static const char * METHOD_PUT
 
static const char * METHOD_DELETE
 

Additional Inherited Members

- Protected Attributes inherited from Resource
AnyReference handle
 

Detailed Description

HTTPS request.

Constructor & Destructor Documentation

◆ HTTPSRequest()

HTTPSRequest::HTTPSRequest ( )

Initializes the request.

Member Function Documentation

◆ getContentLength()

uint64 HTTPSRequest::getContentLength ( )

Returns the content length for the response.

◆ getResponse() [1/3]

String HTTPSRequest::getResponse ( )

Returns the response.

◆ getResponse() [2/3]

void HTTPSRequest::getResponse ( OutputStream os)

Returns the response.

◆ getResponse() [3/3]

void HTTPSRequest::getResponse ( PushInterface pi)

Returns the response.

◆ getResponseHeader() [1/2]

String HTTPSRequest::getResponseHeader ( )

Returns the entire response header.

◆ getResponseHeader() [2/2]

String HTTPSRequest::getResponseHeader ( const String name)

Returns the value of the given header.

◆ getStatus()

unsigned int HTTPSRequest::getStatus ( )

Returns the status.

◆ getStatusText()

String HTTPSRequest::getStatusText ( )

Returns the status text.

◆ isSupported()

static bool HTTPSRequest::isSupported ( )
staticnoexcept

Returns true if HTTPS is supported by the runtime.

◆ load()

static StringPair HTTPSRequest::load ( const String url,
const String method = METHOD_GET,
const String body = String() 
)
static

Simple HTTPS request. Return MIME type and bytes.

◆ open()

bool HTTPSRequest::open ( const String method,
const String url,
const String user = String(),
const String password = String() 
)

Opens request.

Parameters
methodThe connection method. CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE.
urlThe connection url.

◆ send()

void HTTPSRequest::send ( const String body = String())

Sends request.

◆ setAgent()

void HTTPSRequest::setAgent ( const String agent)
inline

Sets the user agent header. Call after open() and before send().

◆ setRequestHeader() [1/2]

void HTTPSRequest::setRequestHeader ( const String header)

Sets the request header. Call after open() and before send(). Do NOT include CRLF.

◆ setRequestHeader() [2/2]

void HTTPSRequest::setRequestHeader ( const String name,
const String value 
)

Sets the request header. Call after open() and before send().