Open 3D Engine HttpRequestor Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
HttpRequestor::HttpRequestorRequests Class Referenceabstract

#include <HttpRequestorBus.h>

Inherits AZ::EBusTraits.

Public Member Functions

virtual void AddRequest (const AZStd::string &URI, Aws::Http::HttpMethod method, const Callback &callback)=0
 
virtual void AddRequestWithHeaders (const AZStd::string &URI, Aws::Http::HttpMethod method, const Headers &headers, const Callback &callback)=0
 
virtual void AddRequestWithHeadersAndBody (const AZStd::string &URI, Aws::Http::HttpMethod method, const Headers &headers, const AZStd::string &body, const Callback &callback)=0
 
virtual void AddTextRequest (const AZStd::string &URI, Aws::Http::HttpMethod method, const TextCallback &callback)=0
 
virtual void AddTextRequestWithHeaders (const AZStd::string &URI, Aws::Http::HttpMethod method, const Headers &headers, const TextCallback &callback)=0
 
virtual void AddTextRequestWithHeadersAndBody (const AZStd::string &URI, Aws::Http::HttpMethod method, const Headers &headers, const AZStd::string &body, const TextCallback &callback)=0
 
virtual AZStd::chrono::milliseconds GetLastRoundTripTime () const =0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 

Detailed Description

Defines request APIs for Gem. Supports making HTTP requests. See HTTP RFC for expectations around methods, headers, and body.

Member Function Documentation

◆ AddRequest()

virtual void HttpRequestor::HttpRequestorRequests::AddRequest ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const Callback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint. Receive the response, via the supplied callback as JSON.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe HTTP method to use, for example HTTP_GET.
callbackThe callback method to receive the JSON response object.

◆ AddRequestWithHeaders()

virtual void HttpRequestor::HttpRequestorRequests::AddRequestWithHeaders ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const Headers &  headers,
const Callback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint with customized headers. Receive the response, via the supplied callback as JSON.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe HTTP method to use, for example HTTP_GET.
headersA map of header names and values to set on the request.
callbackThe callback method to receive the JSON response object.

◆ AddRequestWithHeadersAndBody()

virtual void HttpRequestor::HttpRequestorRequests::AddRequestWithHeadersAndBody ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const Headers &  headers,
const AZStd::string &  body,
const Callback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint with customized headers and a body. Receive the response, via the supplied callback as JSON.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe HTTP method to use, for example HTTP_POST.
headersA map of header names and values to set on the request.
bodyAny HTTP request data to include in the request. Use Content-Type and Content-Length headers to specify the nature of the body payload.
callbackThe callback method to receive the JSON response object.

◆ AddTextRequest()

virtual void HttpRequestor::HttpRequestorRequests::AddTextRequest ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const TextCallback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint. Receive the response, via the supplied callback as text.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe http method to use, for example HTTP_GET.
callbackThe callback method to receive the JSON response object.

◆ AddTextRequestWithHeaders()

virtual void HttpRequestor::HttpRequestorRequests::AddTextRequestWithHeaders ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const Headers &  headers,
const TextCallback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint with customized headers. Receive the response, via the supplied callback as text.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe HTTP method to use, for example HTTP_GET.
headersA map of header names and values to set on the request.
callbackThe callback method to receive the JSON response object.

◆ AddTextRequestWithHeadersAndBody()

virtual void HttpRequestor::HttpRequestorRequests::AddTextRequestWithHeadersAndBody ( const AZStd::string &  URI,
Aws::Http::HttpMethod  method,
const Headers &  headers,
const AZStd::string &  body,
const TextCallback &  callback 
)
pure virtual

Make a RESTful call to a HTTP(s) endpoint with customized headers and a body. Receive the response, via the supplied callback as text.

Parameters
URIThe universal resource indicator representing the endpoint to make the request to.
methodThe HTTP method to use, for example HTTP_POST.
headersA map of header names and values to set on the request.
bodyAny HTTP request data to include in the request. Use Content-Type and Content-Length headers to specify the nature of the body payload.
callbackThe callback method to receive the JSON response object.

◆ GetLastRoundTripTime()

virtual AZStd::chrono::milliseconds HttpRequestor::HttpRequestorRequests::GetLastRoundTripTime ( ) const
pure virtual

Receive the round trip time of the last RESTful call made to a HTTP(s) endpoint. Call this method from inside the supplied callback to get the round trip time of the original request.

Returns
The round trip time in milliseconds.

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