OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
OpenAnima::Http::CurlHttpTransport Class Reference

#include <CurlHttpTransport.h>

Inheritance diagram for OpenAnima::Http::CurlHttpTransport:
OpenAnima::Http::HttpTransport

Public Member Functions

long post (const HttpRequest &request, const ResponseObserver &observer) override
 
HttpResponse post (const HttpRequest &request)
 
- Public Member Functions inherited from OpenAnima::Http::HttpTransport
 HttpTransport (const HttpTransport &)=delete
 Transports are used through a pointer, so copying and moving are not offered.
 
HttpTransport & operator= (const HttpTransport &)=delete
 
 HttpTransport (HttpTransport &&)=delete
 
HttpTransport & operator= (HttpTransport &&)=delete
 
HttpResponse post (const HttpRequest &request)
 

Static Public Member Functions

static std::shared_ptr< HttpTransport > create ()
 

Additional Inherited Members

- Protected Member Functions inherited from OpenAnima::Http::HttpTransport
 HttpTransport ()=default
 Only derived classes build a transport.
 

Detailed Description

HTTP transport built on libcurl, the one client library that offers TLS on both Windows and Linux without platform-specific code.

Member Function Documentation

◆ create()

static std::shared_ptr< HttpTransport > OpenAnima::Http::CurlHttpTransport::create ( )
static
Returns
A transport ready to be injected into a provider.

◆ post() [1/2]

HttpResponse OpenAnima::Http::CurlHttpTransport::post ( const HttpRequest &  request)
inline

Performs a blocking POST and returns the whole answer.

Parameters
requestFully built request.
Returns
The status and the body, buffered.
Exceptions
TransportErrorwhen the exchange cannot be completed at all.

References OpenAnima::Http::HttpTransport::post().

◆ post() [2/2]

long OpenAnima::Http::CurlHttpTransport::post ( const HttpRequest &  request,
const ResponseObserver &  observer 
)
overridevirtual

Performs a blocking POST and reports the answer while it arrives.

The same contract as the interface, written out again because the interface has two post members and a @copydoc cannot say which one counts.

Parameters
requestFully built request.
observerWhere the status and the body go, as they arrive.
Returns
The status the endpoint answered with, or 0 when it reported none.
Exceptions
TransportErrorwhen the exchange cannot be completed at all.

Implements OpenAnima::Http::HttpTransport.


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