engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FHttpRequestAdapterBase类 参考

Adapter class for IHttpRequest abstract interface does not fully expose the wrapped interface in the base. 更多...

#include <HttpRequestAdapter.h>

+ 类 FHttpRequestAdapterBase 继承关系图:

Public 成员函数

virtual void AppendToHeader (const FString &HeaderName, const FString &AdditionalHeaderValue) override
 Appends to the value already set in the header. 更多...
 
virtual void ClearTimeout () override
 Clears the optional timeout in seconds for this HTTP request, causing the default value from FHttpModule::GetTimeout() to be used.
 
virtual TArray< FString > GetAllHeaders () const override
 Return all headers in an array in "Name: Value" format. 更多...
 
virtual const TArray< uint8 > & GetContent () const override
 Get the content payload of the request or response. 更多...
 
virtual int32 GetContentLength () const override
 Shortcut to get the Content-Length header value. 更多...
 
virtual FString GetContentType () const override
 Shortcut to get the Content-Type header value (if available) 更多...
 
virtual float GetElapsedTime () const override
 Gets the time that it took for the server to fully respond to the request. 更多...
 
virtual FString GetHeader (const FString &HeaderName) const override
 Gets the value of a header, or empty string if not found. 更多...
 
virtual const FHttpResponsePtr GetResponse () const override
 Get the associated Response 更多...
 
virtual EHttpRequestStatus::Type GetStatus () const override
 Get the current status of the request being processed 更多...
 
virtual TOptional< float > GetTimeout () const override
 Gets the optional timeout in seconds for this entire HTTP request to complete. 更多...
 
virtual FString GetURL () const override
 Get the URL used to send the request. 更多...
 
virtual FString GetURLParameter (const FString &ParameterName) const override
 Gets an URL parameter. 更多...
 
virtual FString GetVerb () const override
 Gets the verb (GET, PUT, POST) used by the request. 更多...
 
virtual void SetContent (const TArray< uint8 > &ContentPayload) override
 Sets the content of the request (optional data). 更多...
 
virtual void SetContent (TArray< uint8 > &&ContentPayload) override
 Sets the content of the request (optional data). 更多...
 
virtual bool SetContentAsStreamedFile (const FString &Filename) override
 Sets the content of the request to stream from a file. 更多...
 
virtual void SetContentAsString (const FString &ContentString) override
 Sets the content of the request as a string encoded as UTF8. 更多...
 
virtual bool SetContentFromStream (TSharedRef< FArchive, ESPMode::ThreadSafe > Stream) override
 Sets the content of the request to stream directly from an archive. 更多...
 
virtual void SetHeader (const FString &HeaderName, const FString &HeaderValue) override
 Sets optional header info. 更多...
 
virtual void SetTimeout (float InTimeoutSecs) override
 Sets an optional timeout in seconds for this entire HTTP request to complete. 更多...
 
virtual void SetURL (const FString &URL) override
 Sets the URL for the request Eg. 更多...
 
virtual void SetVerb (const FString &Verb) override
 Sets the verb used by the request. 更多...
 
virtual void Tick (float DeltaSeconds) override
 Used to tick the request 更多...
 
- Public 成员函数 继承自 FHttpRequestImpl
virtual void ClearTimeout () override
 Clears the optional timeout in seconds for this HTTP request, causing the default value from FHttpModule::GetTimeout() to be used.
 
virtual TOptional< float > GetTimeout () const override
 Gets the optional timeout in seconds for this entire HTTP request to complete. 更多...
 
virtual FHttpRequestHeaderReceivedDelegate & OnHeaderReceived () override
 Delegate called to signal the receipt of a header. 更多...
 
virtual FHttpRequestCompleteDelegate & OnProcessRequestComplete () override
 Delegate called when the request is complete. 更多...
 
virtual FHttpRequestProgressDelegate & OnRequestProgress () override
 Delegate called to update the request/response progress. 更多...
 
virtual FHttpRequestWillRetryDelegate & OnRequestWillRetry () override
 Delegate called when the request will be retried
 
virtual void SetTimeout (float InTimeoutSecs) override
 Sets an optional timeout in seconds for this entire HTTP request to complete. 更多...
 
- Public 成员函数 继承自 IHttpRequest
virtual void AppendToHeader (const FString &HeaderName, const FString &AdditionalHeaderValue)=0
 Appends to the value already set in the header. 更多...
 
virtual void CancelRequest ()=0
 Called to cancel a request that is still being processed
 
virtual void ClearTimeout ()=0
 Clears the optional timeout in seconds for this HTTP request, causing the default value from FHttpModule::GetTimeout() to be used.
 
virtual float GetElapsedTime () const =0
 Gets the time that it took for the server to fully respond to the request. 更多...
 
virtual const FHttpResponsePtr GetResponse () const =0
 Get the associated Response 更多...
 
virtual EHttpRequestStatus::Type GetStatus () const =0
 Get the current status of the request being processed 更多...
 
virtual TOptional< float > GetTimeout () const =0
 Gets the optional timeout in seconds for this entire HTTP request to complete. 更多...
 
virtual FString GetVerb () const =0
 Gets the verb (GET, PUT, POST) used by the request. 更多...
 
virtual FHttpRequestHeaderReceivedDelegate & OnHeaderReceived ()=0
 Delegate called to signal the receipt of a header. 更多...
 
virtual FHttpRequestCompleteDelegate & OnProcessRequestComplete ()=0
 Delegate called when the request is complete. 更多...
 
virtual FHttpRequestProgressDelegate & OnRequestProgress ()=0
 Delegate called to update the request/response progress. 更多...
 
virtual FHttpRequestWillRetryDelegate & OnRequestWillRetry ()=0
 Delegate called when the request will be retried
 
virtual bool ProcessRequest ()=0
 Called to begin processing the request. 更多...
 
virtual void SetContent (const TArray< uint8 > &ContentPayload)=0
 Sets the content of the request (optional data). 更多...
 
virtual void SetContent (TArray< uint8 > &&ContentPayload)=0
 Sets the content of the request (optional data). 更多...
 
virtual bool SetContentAsStreamedFile (const FString &Filename)=0
 Sets the content of the request to stream from a file. 更多...
 
virtual void SetContentAsString (const FString &ContentString)=0
 Sets the content of the request as a string encoded as UTF8. 更多...
 
virtual bool SetContentFromStream (TSharedRef< FArchive, ESPMode::ThreadSafe > Stream)=0
 Sets the content of the request to stream directly from an archive. 更多...
 
virtual void SetHeader (const FString &HeaderName, const FString &HeaderValue)=0
 Sets optional header info. 更多...
 
virtual void SetTimeout (float InTimeoutSecs)=0
 Sets an optional timeout in seconds for this entire HTTP request to complete. 更多...
 
virtual void SetURL (const FString &URL)=0
 Sets the URL for the request Eg. 更多...
 
virtual void SetVerb (const FString &Verb)=0
 Sets the verb used by the request. 更多...
 
virtual void Tick (float DeltaSeconds)=0
 Used to tick the request 更多...
 
virtual ~IHttpRequest ()=default
 Destructor for overrides
 
- Public 成员函数 继承自 IHttpBase
virtual TArray< FString > GetAllHeaders () const =0
 Return all headers in an array in "Name: Value" format. 更多...
 
virtual const TArray< uint8 > & GetContent () const =0
 Get the content payload of the request or response. 更多...
 
virtual int32 GetContentLength () const =0
 Shortcut to get the Content-Length header value. 更多...
 
virtual FString GetContentType () const =0
 Shortcut to get the Content-Type header value (if available) 更多...
 
virtual FString GetHeader (const FString &HeaderName) const =0
 Gets the value of a header, or empty string if not found. 更多...
 
virtual FString GetURL () const =0
 Get the URL used to send the request. 更多...
 
virtual FString GetURLParameter (const FString &ParameterName) const =0
 Gets an URL parameter. 更多...
 
virtual ~IHttpBase ()=default
 Destructor for overrides
 
- Public 成员函数 继承自 TSharedFromThis< IHttpRequest, ESPMode::ThreadSafe >
TSharedRef< IHttpRequest, Mode > AsShared ()
 Provides access to a shared reference to this object. 更多...
 
TSharedRef< IHttpRequest const, Mode > AsShared () const
 Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. 更多...
 
FORCEINLINE bool DoesSharedInstanceExist () const
 Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared). 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, Mode > const *InSharedPtr, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, Mode > const *InSharedRef, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 

额外继承的成员函数

- Protected 成员函数 继承自 FHttpRequestImpl
void BroadcastResponseHeadersReceived ()
 Broadcast all of our response's headers as having been received Used when we don't know when we receive headers in our HTTP implementation
 
- Protected 成员函数 继承自 TSharedFromThis< IHttpRequest, ESPMode::ThreadSafe >
FORCEINLINE TSharedFromThis & operator= (TSharedFromThis const &)
 Hidden stub assignment operator
 
 TSharedFromThis ()
 Hidden stub constructor
 
 TSharedFromThis (TSharedFromThis const &)
 Hidden stub copy constructor
 
 ~TSharedFromThis ()
 Hidden destructor
 
- 静态 Protected 成员函数 继承自 TSharedFromThis< IHttpRequest, ESPMode::ThreadSafe >
static FORCEINLINE TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 
static FORCEINLINE TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 
- Protected 属性 继承自 FHttpRequestImpl
FHttpRequestHeaderReceivedDelegate HeaderReceivedDelegate
 Delegate that will get called for each new header received
 
FHttpRequestWillRetryDelegate OnRequestWillRetryDelegate
 Delegate that will get called when request will be retried
 
FHttpRequestCompleteDelegate RequestCompleteDelegate
 Delegate that will get called once request completes or on any error
 
FHttpRequestProgressDelegate RequestProgressDelegate
 Delegate that will get called once per tick with bytes downloaded so far
 
TOptional< float > TimeoutSecs
 Timeout in seconds for the entire HTTP request to complete
 

详细描述

Adapter class for IHttpRequest abstract interface does not fully expose the wrapped interface in the base.

This allows client defined marshalling of the requests when end point permissions are at issue.

成员函数说明

◆ AppendToHeader()

virtual void FHttpRequestAdapterBase::AppendToHeader ( const FString &  HeaderName,
const FString &  AdditionalHeaderValue 
)
inlineoverridevirtual

Appends to the value already set in the header.

If there is already content in that header, a comma delimiter is used. If the header is as of yet unset, the result is the same as calling SetHeader Content-Length is the only header set for you. Also see: SetHeader()

参数
HeaderName- Name of the header (ie, Content-Type)
AdditionalHeaderValue- Value to add to the existing contents of the specified header. comma is inserted between old value and new value, per HTTP specifications

实现了 IHttpRequest.

◆ GetAllHeaders()

virtual TArray< FString > FHttpRequestAdapterBase::GetAllHeaders ( ) const
inlineoverridevirtual

Return all headers in an array in "Name: Value" format.

返回
the header array of strings

实现了 IHttpBase.

◆ GetContent()

virtual const TArray< uint8 > & FHttpRequestAdapterBase::GetContent ( ) const
inlineoverridevirtual

Get the content payload of the request or response.

参数
Content- array that will be filled with the content.

实现了 IHttpBase.

◆ GetContentLength()

virtual int32 FHttpRequestAdapterBase::GetContentLength ( ) const
inlineoverridevirtual

Shortcut to get the Content-Length header value.

Will not always return non-zero. If you want the real length of the payload, get the payload and check it's length.

返回
the content length (if available)

实现了 IHttpBase.

◆ GetContentType()

virtual FString FHttpRequestAdapterBase::GetContentType ( ) const
inlineoverridevirtual

Shortcut to get the Content-Type header value (if available)

返回
the content type.

实现了 IHttpBase.

◆ GetElapsedTime()

virtual float FHttpRequestAdapterBase::GetElapsedTime ( ) const
inlineoverridevirtual

Gets the time that it took for the server to fully respond to the request.

返回
elapsed time in seconds.

实现了 IHttpRequest.

◆ GetHeader()

virtual FString FHttpRequestAdapterBase::GetHeader ( const FString &  HeaderName) const
inlineoverridevirtual

Gets the value of a header, or empty string if not found.

参数
HeaderName- name of the header to set.

实现了 IHttpBase.

◆ GetResponse()

virtual const FHttpResponsePtr FHttpRequestAdapterBase::GetResponse ( ) const
inlineoverridevirtual

Get the associated Response

返回
the response

实现了 IHttpRequest.

◆ GetStatus()

virtual EHttpRequestStatus::Type FHttpRequestAdapterBase::GetStatus ( ) const
inlineoverridevirtual

Get the current status of the request being processed

返回
the current status

实现了 IHttpRequest.

◆ GetTimeout()

virtual TOptional< float > FHttpRequestAdapterBase::GetTimeout ( ) const
inlineoverridevirtual

Gets the optional timeout in seconds for this entire HTTP request to complete.

If valid, this value overrides the default HTTP timeout set via FHttpModule::SetTimeout().

返回
the timeout for this HTTP request instance, in seconds

重载 FHttpRequestImpl .

◆ GetURL()

virtual FString FHttpRequestAdapterBase::GetURL ( ) const
inlineoverridevirtual

Get the URL used to send the request.

返回
the URL string.

实现了 IHttpBase.

◆ GetURLParameter()

virtual FString FHttpRequestAdapterBase::GetURLParameter ( const FString &  ParameterName) const
inlineoverridevirtual

Gets an URL parameter.

expected format is ?Key=Value&Key=Value... If that format is not used, this function will not work.

参数
ParameterName- the parameter to request.
返回
the parameter value string.

实现了 IHttpBase.

◆ GetVerb()

virtual FString FHttpRequestAdapterBase::GetVerb ( ) const
inlineoverridevirtual

Gets the verb (GET, PUT, POST) used by the request.

返回
the verb string

实现了 IHttpRequest.

◆ SetContent() [1/2]

virtual void FHttpRequestAdapterBase::SetContent ( const TArray< uint8 > &  ContentPayload)
inlineoverridevirtual

Sets the content of the request (optional data).

Usually only set for POST requests.

参数
ContentPayload- payload to set.

实现了 IHttpRequest.

◆ SetContent() [2/2]

virtual void FHttpRequestAdapterBase::SetContent ( TArray< uint8 > &&  ContentPayload)
inlineoverridevirtual

Sets the content of the request (optional data).

Usually only set for POST requests.

This version lets the API take ownership of the payload directly, helpful for larger payloads.

参数
ContentPayload- payload to set.

实现了 IHttpRequest.

◆ SetContentAsStreamedFile()

virtual bool FHttpRequestAdapterBase::SetContentAsStreamedFile ( const FString &  Filename)
inlineoverridevirtual

Sets the content of the request to stream from a file.

参数
FileName- filename from which to stream the body.
返回
True if the file is valid and will be used to stream the request. False otherwise.

实现了 IHttpRequest.

◆ SetContentAsString()

virtual void FHttpRequestAdapterBase::SetContentAsString ( const FString &  ContentString)
inlineoverridevirtual

Sets the content of the request as a string encoded as UTF8.

参数
ContentString- payload to set.

实现了 IHttpRequest.

◆ SetContentFromStream()

virtual bool FHttpRequestAdapterBase::SetContentFromStream ( TSharedRef< FArchive, ESPMode::ThreadSafe >  Stream)
inlineoverridevirtual

Sets the content of the request to stream directly from an archive.

参数
Stream- archive from which the payload should be streamed.
返回
True if the archive can be used to stream the request. False otherwise.

实现了 IHttpRequest.

◆ SetHeader()

virtual void FHttpRequestAdapterBase::SetHeader ( const FString &  HeaderName,
const FString &  HeaderValue 
)
inlineoverridevirtual

Sets optional header info.

SetHeader for a given HeaderName will overwrite any previous values Use AppendToHeader to append more values for the same header Content-Length is the only header set for you. Required headers depends on the request itself. Eg. "multipart/form-data" needed for a form post

参数
HeaderName- Name of the header (ie, Content-Type)
HeaderValue- Value of the header

实现了 IHttpRequest.

◆ SetTimeout()

virtual void FHttpRequestAdapterBase::SetTimeout ( float  InTimeoutSecs)
inlineoverridevirtual

Sets an optional timeout in seconds for this entire HTTP request to complete.

If set, this value overrides the default HTTP timeout set via FHttpModule::SetTimeout().

参数
InTimeoutSecs- Timeout for this HTTP request instance, in seconds

重载 FHttpRequestImpl .

◆ SetURL()

virtual void FHttpRequestAdapterBase::SetURL ( const FString &  URL)
inlineoverridevirtual

Sets the URL for the request Eg.

(http://my.domain.com/something.ext?key=value&key2=value). Must be set before calling ProcessRequest.

参数
URL- URL to use.

实现了 IHttpRequest.

◆ SetVerb()

virtual void FHttpRequestAdapterBase::SetVerb ( const FString &  Verb)
inlineoverridevirtual

Sets the verb used by the request.

Eg. (GET, PUT, POST) Should be set before calling ProcessRequest. If not specified then a GET is assumed.

参数
Verb- verb to use.

实现了 IHttpRequest.

◆ Tick()

virtual void FHttpRequestAdapterBase::Tick ( float  DeltaSeconds)
inlineoverridevirtual

Used to tick the request

参数
DeltaSeconds- seconds since last ticked

实现了 IHttpRequest.


该类的文档由以下文件生成: