Skip to content
xXTurner edited this page May 13, 2020 · 1 revision

Basic API Docs:

(i will make a proper one once ( if ) i finish the project)


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 for Ivalid URI and -1 for SSL 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 by Header
    @return(boolean true|false) | If the function succeeds the return value is true, if it fails (internal error) its false. (should be always true)
    @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) | Returns char* 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.

Clone this wiki locally