#include <Request.h>
◆ Request() [1/5]
ehs::Request::Request |
( |
| ) |
|
Default member initialization.
◆ Request() [2/5]
ehs::Request::Request |
( |
const Verb | verb, |
|
|
const Str_8 & | rsrc ) |
Initializes this request with a given verb and URI resource.
- Parameters
-
[in] | verb | The type of request to make. |
[in] | rsrc | The URI endpoint to make the request at. |
◆ Request() [3/5]
ehs::Request::Request |
( |
const char * | data, |
|
|
const UInt_64 | size ) |
Initializes this request with the raw request data.
- Parameters
-
[in] | data | The C-style string of the request. |
[in] | size | The size of the given C-style string. |
◆ Request() [4/5]
ehs::Request::Request |
( |
const Str_8 & | data | ) |
|
Initializes this request with the raw request data.
- Parameters
-
[in] | data | The string of the request. |
◆ Request() [5/5]
ehs::Request::Request |
( |
const Request & | req | ) |
|
|
default |
Copies members from another object of the same type.
- Parameters
-
[in] | req | The object to copy from. |
◆ AddQuery()
void ehs::Request::AddQuery |
( |
const Str_8 & | var, |
|
|
const Str_8 & | value ) |
Adds a query variable to the URI.
- Parameters
-
[in] | var | The variable identifier. |
[in] | value | The value of the variable. |
◆ AddToBody() [1/2]
void ehs::Request::AddToBody |
( |
const Str_8 & | data | ) |
|
Adds a value to the body.
- Parameters
-
[in] | data | The value to add. |
◆ AddToBody() [2/2]
void ehs::Request::AddToBody |
( |
const Str_8 & | var, |
|
|
const Str_8 & | value ) |
Adds a body variable.
- Parameters
-
[in] | var | The variable identifier. |
[in] | value | The value of the variable. |
◆ AddToHeader()
void ehs::Request::AddToHeader |
( |
const Str_8 & | var, |
|
|
const Str_8 & | value ) |
Adds a header variable.
- Parameters
-
[in] | var | The variable identifier. |
[in] | value | The value of the variable. |
◆ BasicAuth()
void ehs::Request::BasicAuth |
( |
const Str_8 & | id, |
|
|
const Str_8 & | secret ) |
A helper method to automatically add the required header variables for basic authentication.
- Parameters
-
[in] | id | The username or id. |
[in] | secret | The secret given by an API. |
◆ BearerAuth() [1/2]
void ehs::Request::BearerAuth |
( |
const Str_8 & | token | ) |
|
A helper method to automatically add the required header variables for bearer authentication.
- Parameters
-
[in] | token | The token given by an API. |
◆ BearerAuth() [2/2]
void ehs::Request::BearerAuth |
( |
const Str_8 & | token, |
|
|
const Str_8 & | clientId ) |
A helper method to automatically add the required header variables for bearer authentication.
- Parameters
-
[in] | token | The token given by an API. |
[in] | clientId | The client id given by an API. |
◆ BotAuth()
void ehs::Request::BotAuth |
( |
const Str_8 & | token | ) |
|
A helper method to automatically add the required header variables for bot authentication.
- Parameters
-
[in] | token | The token given by an API. |
◆ FormResult()
Str_8 ehs::Request::FormResult |
( |
| ) |
const |
Forms the raw result of the request to be sent.
- Returns
- The result.
◆ GetBody()
Str_8 ehs::Request::GetBody |
( |
| ) |
const |
Retrieves the entire body.
- Returns
- The result.
◆ GetContentType()
Retrieves the content type for the body.
- Returns
- The result.
◆ GetHeader() [1/2]
Retrieves all the header variables in a vector object.
- Returns
- The result.
◆ GetHeader() [2/2]
Str_8 ehs::Request::GetHeader |
( |
const Str_8 & | var | ) |
const |
Retrieves a header variable.
- Parameters
-
[in] | var | The variable identifier to look for. |
- Returns
- The value of the header variable. Empty if it was not found.
◆ GetJson()
Json ehs::Request::GetJson |
( |
| ) |
const |
Retrieves the entire body as a Json.
- Returns
- The result.
◆ GetQueries()
Retrieves all the query variables from the URI in a vector object.
- Returns
- The result.
◆ GetQuery()
Retrieves a query variable from the URI.
- Parameters
-
[in] | var | The variable identifier to look for. |
- Returns
- The value of the query variable. Empty if it was not found.
◆ GetResource()
Str_8 ehs::Request::GetResource |
( |
| ) |
const |
Retrieves the URI resource.
- Returns
- The result.
◆ GetVar()
Str_8 ehs::Request::GetVar |
( |
const Str_8 & | var | ) |
const |
Retrieves a body variable.
- Parameters
-
[in] | var | The variable identifier to look for. |
- Returns
- The value of the body variable. Empty if it was not found.
◆ GetVerb()
Verb ehs::Request::GetVerb |
( |
| ) |
const |
Retrieves the verb for the request.
- Returns
- The result.
◆ IsValid()
bool ehs::Request::IsValid |
( |
| ) |
const |
◆ operator=()
Copies members from another object of the same type.
- Parameters
-
[in] | req | The object to copy from. |
- Returns
- The request that has been assigned to.
◆ SetBody()
void ehs::Request::SetBody |
( |
const Str_8 & | body | ) |
|
Sets the entire body.
- Parameters
-
◆ SetContentType()
void ehs::Request::SetContentType |
( |
const ContentType | cType | ) |
|
Sets the content type for the body.
- Parameters
-
[in] | cType | The content type to use. |
◆ SetResource()
void ehs::Request::SetResource |
( |
const Str_8 & | rsrc | ) |
|
Sets the URI resource.
- Parameters
-
The documentation for this class was generated from the following files: