Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::HttpClient Struct Reference

Http async client. More...

#include <HttpClient.h>

Public Member Functions

Result get (AsyncEventLoop &loop, StringView url)
 Setups this client to execute a GET request on the given url. More...
 
StringView getResponse () const
 Get the response StringView sent by the server. More...
 
Result setCustomDebugName (const StringView debugName)
 

Public Attributes

Delegate< HttpClient & > callback
 The callback that is called after GET operation succeeded. More...
 

Detailed Description

Http async client.

Member Function Documentation

◆ get()

Result SC::HttpClient::get ( AsyncEventLoop loop,
StringView  url 
)

Setups this client to execute a GET request on the given url.

Parameters
loopThe AsyncEventLoop to use for monitoring network packets
urlThe url to GET
Returns
Valid Result if dns resolution and creation of underlying client tcp socket succeeded

◆ getResponse()

StringView SC::HttpClient::getResponse ( ) const

Get the response StringView sent by the server.

Member Data Documentation

◆ callback

Delegate<HttpClient&> SC::HttpClient::callback

The callback that is called after GET operation succeeded.


The documentation for this struct was generated from the following file: