-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Class GetRequest:
-
(constructor) - Links the object returned from
GetRequest::GetData()
to an internal buffer.
@param(FILE* temp_pSTDOUT) | This is temporary, for debugging! stdout object in order to write to the console stream from the library (.lib). -
(destructor) - Deallocates the object returned from
GetRequest::GetData()
-
RESPONSE SendRequest(Address szURI, Port nPort = 443) - Sends a GET request to the address supplied by
szURI
via HTTP/2.0
@param(Address szURI) | Pointer to a cstring. ex: 'discord.com'.
@param(Port nPort = 443) | The port the request is going to be send on. Should leave it default mostly.
@return(signed number) | Returns the HTTP Response Code if the request was successful, if not returns 0 forIvalid URI
and -1 forSSL Certificate Error
@type(Address) |typedef const char* Address
@type(Port) |typedef short Port
-
bool AddHeader(HeaderType Header, HeaderValue szValue) | Adds custom header to the request.
@param(HeaderType Header) | Enum type, of the header name. ex: 'HeaderType::User_Agent'
@param(HeaderValue szValue) | This is constant cstring which is the value of the header specified byHeader
@return(boolean true|false) | If the function succeeds the return value istrue
, if itfails
(internal error) its false. (should be alwaystrue
)
@type(HeaderType) |enum class HeaderType : char
@type(HeaderValue) |typedef const char* HeaderValue
-
const char* GetData() | Returns the pointer to the internal
char*
buffer.
@return(string cstring) | Returnschar*
pointer to the internal buffer. ex: 'printf("Data:%s\n", GetData())', 'std::cout << "Data" << GetData() << std::endl'. GetData() should be used as object.GetData(), this is only an example.