|
| | FClosedHttpRequest (FTransactionallySafeHttpRequest *Owner) |
| |
| | ~FClosedHttpRequest () |
| |
| const FString & | GetURL () const override |
| |
| void | SetURL (const FString &InURL) override |
| |
| void | SetHeader (const FString &HeaderName, const FString &HeaderValue) override |
| |
| FString | GetHeader (const FString &HeaderName) const override |
| |
| void | AppendToHeader (const FString &HeaderName, const FString &AdditionalHeaderValue) override |
| |
| TArray< FString > | GetAllHeaders () const override |
| |
| FString | GetVerb () const override |
| |
| void | SetVerb (const FString &InVerb) override |
| |
| FString | GetOption (const FName Option) const override |
| |
| void | SetOption (const FName Option, const FString &OptionValue) override |
| |
| void | SetContent (const TArray< uint8 > &InPayload) override |
| |
| void | SetContent (TArray< uint8 > &&InPayload) override |
| |
| const TArray< uint8 > & | GetContent () const override |
| |
| void | SetContentAsString (const FString &ContentString) override |
| |
| bool | SetContentAsStreamedFile (const FString &Filename) override |
| |
| bool | SetContentFromStream (TSharedRef< FArchive, ESPMode::ThreadSafe > Stream) override |
| |
| EHttpRequestStatus::Type | GetStatus () const override |
| |
| const FString & | GetEffectiveURL () const override |
| |
| FString | GetURLParameter (const FString &ParameterName) const override |
| |
| uint64 | GetContentLength () const override |
| |
| FString | GetContentType () const override |
| |
| bool | SetResponseBodyReceiveStream (TSharedRef< FArchive > Stream) override |
| |
| EHttpFailureReason | GetFailureReason () const override |
| |
| const FHttpResponsePtr | GetResponse () const override |
| |
| void | Tick (float) override |
| |
| float | GetElapsedTime () const override |
| |
| void | SetDelegateThreadPolicy (EHttpRequestDelegateThreadPolicy InThreadPolicy) override |
| |
| EHttpRequestDelegateThreadPolicy | GetDelegateThreadPolicy () const override |
| |
| void | SetPriority (EHttpRequestPriority InPriority) override |
| |
| EHttpRequestPriority | GetPriority () const override |
| |
| bool | ProcessRequest () override |
| |
| void | CancelRequest () override |
| |
| void | ProcessRequestUntilComplete () override |
| |
| void | SetTimeout (float InTimeoutSecs) override |
| |
| void | SetActivityTimeout (float InTimeoutSecs) override |
| |
| void | ClearTimeout () override |
| |
| void | ResetTimeoutStatus () override |
| |
| TOptional< float > | GetTimeout () const override |
| |
| FHttpRequestCompleteDelegate & | OnProcessRequestComplete () override |
| |
| FHttpRequestProgressDelegate64 & | OnRequestProgress64 () override |
| |
| FHttpRequestWillRetryDelegate & | OnRequestWillRetry () override |
| |
| FHttpRequestHeaderReceivedDelegate & | OnHeaderReceived () override |
| |
| FHttpRequestStatusCodeReceivedDelegate & | OnStatusCodeReceived () override |
| |
| HTTP_API bool | SetResponseBodyReceiveStreamDelegateV2 (FHttpRequestStreamDelegateV2 StreamDelegate) |
| |
| virtual | ~IHttpRequest ()=default |
| |
| virtual | ~IHttpBase ()=default |
| |
| TSharedRef< IHttpRequest, Mode > | AsShared () |
| |
| TSharedRef< IHttpRequest const, Mode > | AsShared () const |
| |
| TSharedRef< SubobjectType, Mode > | AsSharedSubobject (SubobjectType *SubobjectPtr) const |
| |
| TWeakPtr< IHttpRequest, Mode > | AsWeak () |
| |
| TWeakPtr< IHttpRequest const, Mode > | AsWeak () const |
| |
| TWeakPtr< SubobjectType, Mode > | AsWeakSubobject (SubobjectType *SubobjectPtr) const |
| |
| void | UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const |
| |
| void | UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const |
| |
| UE_FORCEINLINE_HINT bool | DoesSharedInstanceExist () const |
| |
◆ FClosedHttpRequest()
◆ ~FClosedHttpRequest()
| FTransactionallySafeHttpRequest::FClosedHttpRequest::~FClosedHttpRequest |
( |
| ) |
|
|
inline |
◆ AppendToHeader()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::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()
- Parameters
-
| 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 |
Implements IHttpRequest.
◆ CancelRequest()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::CancelRequest |
( |
| ) |
|
|
inlineoverridevirtual |
Called to cancel a request that is still being processed
Implements IHttpRequest.
◆ ClearTimeout()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::ClearTimeout |
( |
| ) |
|
|
inlineoverridevirtual |
Clears the optional timeout in seconds for this HTTP request, causing the default value from FHttpModule::GetTimeout() to be used.
Implements IHttpRequest.
◆ GetAllHeaders()
| TArray< FString > FTransactionallySafeHttpRequest::FClosedHttpRequest::GetAllHeaders |
( |
| ) |
const |
|
inlineoverridevirtual |
Return all headers in an array in "Name: Value" format.
- Returns
- the header array of strings
Implements IHttpBase.
◆ GetContent()
| const TArray< uint8 > & FTransactionallySafeHttpRequest::FClosedHttpRequest::GetContent |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the content payload of the request or response.
- Parameters
-
| Content | - array that will be filled with the content. |
Implements IHttpBase.
◆ GetContentLength()
| uint64 FTransactionallySafeHttpRequest::FClosedHttpRequest::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.
- Returns
- the content length (if available)
Implements IHttpBase.
◆ GetContentType()
| FString FTransactionallySafeHttpRequest::FClosedHttpRequest::GetContentType |
( |
| ) |
const |
|
inlineoverridevirtual |
Shortcut to get the Content-Type header value (if available)
- Returns
- the content type.
Implements IHttpBase.
◆ GetDelegateThreadPolicy()
Get thread policy about which thread to complete this request
- Returns
- The thread policy
Implements IHttpRequest.
◆ GetEffectiveURL()
| const FString & FTransactionallySafeHttpRequest::FClosedHttpRequest::GetEffectiveURL |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the effective URL in case of redirected. If not redirected, it's the same as GetURL
- Returns
- the effective URL string.
Implements IHttpBase.
◆ GetElapsedTime()
| float FTransactionallySafeHttpRequest::FClosedHttpRequest::GetElapsedTime |
( |
| ) |
const |
|
inlineoverridevirtual |
Gets the time that it took for the server to fully respond to the request.
- Returns
- elapsed time in seconds.
Implements IHttpRequest.
◆ GetFailureReason()
| EHttpFailureReason FTransactionallySafeHttpRequest::FClosedHttpRequest::GetFailureReason |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the reason of th failure if GetStatus returns Failed
- Returns
- the reason of the failure
Implements IHttpBase.
◆ GetHeader()
| FString FTransactionallySafeHttpRequest::FClosedHttpRequest::GetHeader |
( |
const FString & |
HeaderName | ) |
const |
|
inlineoverridevirtual |
Gets the value of a header, or empty string if not found.
- Parameters
-
| HeaderName | - name of the header to set. |
Implements IHttpBase.
◆ GetOption()
| FString FTransactionallySafeHttpRequest::FClosedHttpRequest::GetOption |
( |
const FName |
Option | ) |
const |
|
inlineoverridevirtual |
Get the current value for the given option
- Returns
- the current value set for this option or an empty string if no value has been specified
Implements IHttpRequest.
◆ GetPriority()
Get request priority, which is used to decide the position in the queue when max concurrent limit reached
- Returns
- The request priority
Implements IHttpRequest.
◆ GetResponse()
| const FHttpResponsePtr FTransactionallySafeHttpRequest::FClosedHttpRequest::GetResponse |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the associated Response
- Returns
- the response
Implements IHttpRequest.
◆ GetStatus()
Get the current status of the request being processed
- Returns
- the current status
Implements IHttpBase.
◆ GetTimeout()
| TOptional< float > FTransactionallySafeHttpRequest::FClosedHttpRequest::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().
- Returns
- the timeout for this HTTP request instance, in seconds
Implements IHttpRequest.
◆ GetURL()
| const FString & FTransactionallySafeHttpRequest::FClosedHttpRequest::GetURL |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the URL used to send the request.
- Returns
- the URL string.
Implements IHttpBase.
◆ GetURLParameter()
| FString FTransactionallySafeHttpRequest::FClosedHttpRequest::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.
- Parameters
-
| ParameterName | - the parameter to request. |
- Returns
- the parameter value string.
Implements IHttpBase.
◆ GetVerb()
| FString FTransactionallySafeHttpRequest::FClosedHttpRequest::GetVerb |
( |
| ) |
const |
|
inlineoverridevirtual |
Gets the verb (GET, PUT, POST) used by the request.
- Returns
- the verb string
Implements IHttpRequest.
◆ OnHeaderReceived()
Delegate called to signal the receipt of a header. See FHttpRequestHeaderReceivedDelegate
Implements IHttpRequest.
◆ OnProcessRequestComplete()
Delegate called when the request is complete. See FHttpRequestCompleteDelegate
Implements IHttpRequest.
◆ OnRequestProgress64()
Delegate called to update the request/response progress. See FHttpRequestProgressDelegate64
Implements IHttpRequest.
◆ OnRequestWillRetry()
Delegate called when the request will be retried
Implements IHttpRequest.
◆ OnStatusCodeReceived()
Delegate called to signal the receipt of a header. See FHttpRequestStatusCodeReceivedDelegate
Implements IHttpRequest.
◆ ProcessRequest()
| bool FTransactionallySafeHttpRequest::FClosedHttpRequest::ProcessRequest |
( |
| ) |
|
|
inlineoverridevirtual |
Called to begin processing the request. OnProcessRequestComplete delegate is always called when the request completes or on error if it is bound. A request can be re-used but not while still being processed.
- Returns
- if the request was successfully started.
Implements IHttpRequest.
◆ ProcessRequestUntilComplete()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::ProcessRequestUntilComplete |
( |
| ) |
|
|
inlineoverridevirtual |
Blocking call to wait the request until it's completed
WARNINGS:
- This is a blocking call, DON'T use this in a time-sensitive context
- Complete delegate will be used in this function so customized complete delegate is not supported
- This will force the usage of EHttpRequestDelegateThreadPolicy::CompleteOnHttpThread to make sure the request can complete, when this function get called from main thread. So if any other delegate is bound, make sure the bound delegate can handle the custom logic in a thread-safe way
Implements IHttpRequest.
◆ ResetTimeoutStatus()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::ResetTimeoutStatus |
( |
| ) |
|
|
inlineoverridevirtual |
Reset the elapsed timeout duration and flag, after the request completed and need to be reused
Implements IHttpRequest.
◆ SetActivityTimeout()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::SetActivityTimeout |
( |
float |
InTimeoutSecs | ) |
|
|
inlineoverridevirtual |
Sets an optional activity timeout in seconds for this HTTP request. After connecting to web server, if there is no activity(send or receive) happen for this time period, it will trigger activity timeout If set, this value overrides the default HTTP activity timeout
- Parameters
-
| InTimeoutSecs | - Timeout for this HTTP request instance, in seconds |
Implements IHttpRequest.
◆ SetContent() [1/2]
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::SetContent |
( |
const TArray< uint8 > & |
ContentPayload | ) |
|
|
inlineoverridevirtual |
Sets the content of the request (optional data). Usually only set for POST requests.
- Parameters
-
| ContentPayload | - payload to set. |
Implements IHttpRequest.
◆ SetContent() [2/2]
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::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.
- Parameters
-
| ContentPayload | - payload to set. |
Implements IHttpRequest.
◆ SetContentAsStreamedFile()
| bool FTransactionallySafeHttpRequest::FClosedHttpRequest::SetContentAsStreamedFile |
( |
const FString & |
Filename | ) |
|
|
inlineoverridevirtual |
Sets the content of the request to stream from a file.
- Parameters
-
| FileName | - filename from which to stream the body. |
- Returns
- True if the file is valid and will be used to stream the request. False otherwise.
Implements IHttpRequest.
◆ SetContentAsString()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::SetContentAsString |
( |
const FString & |
ContentString | ) |
|
|
inlineoverridevirtual |
Sets the content of the request as a string encoded as UTF8.
- Parameters
-
| ContentString | - payload to set. |
Implements IHttpRequest.
◆ SetContentFromStream()
Sets the content of the request to stream directly from an archive. NOTE: The Stream->Serialize will be called from another thread other than the game thread
- Parameters
-
| Stream | - archive from which the payload should be streamed. |
- Returns
- True if the archive can be used to stream the request. False otherwise.
Implements IHttpRequest.
◆ SetDelegateThreadPolicy()
◆ SetHeader()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::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
- Parameters
-
| HeaderName | - Name of the header (ie, Content-Type) |
| HeaderValue | - Value of the header |
Implements IHttpRequest.
◆ SetOption()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::SetOption |
( |
const FName |
Option, |
|
|
const FString & |
OptionValue |
|
) |
| |
|
inlineoverridevirtual |
Sets the given option for this Request Must be set before calling ProcessRequest.
- Parameters
-
| Option | - The option to set, see 'HttpRequestOptions' for supported options |
| OptionValue | - The value of the option to set |
Implements IHttpRequest.
◆ SetPriority()
Set priority of the request, which will be used to decide the position in the queue when max concurrent limit reached
- Parameters
-
| InHttpRequestPriority | - The priority to set |
Implements IHttpRequest.
◆ SetResponseBodyReceiveStream()
| bool FTransactionallySafeHttpRequest::FClosedHttpRequest::SetResponseBodyReceiveStream |
( |
TSharedRef< FArchive > |
Stream | ) |
|
|
inlineoverridevirtual |
Sets the stream to receive the response body. Make sure to handle the cleanup of stream when Serialize generated error(Stream->GetError returns true after Stream->Serialize call), this http request will fail and quit.
NOTE: Once set, the data will no longer be cached in response, IHttpResponse::GetContent() and IHttpResponse::GetContentAsString() will return empty result. The Stream->Serialize will be called from another thread other than the game thread
- Parameters
-
| Stream | - will be used to receive the response body |
- Returns
- True if the stream can be used. False otherwise.
Implements IHttpRequest.
◆ SetTimeout()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::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().
- Parameters
-
| InTimeoutSecs | - Timeout for this HTTP request instance, in seconds |
Implements IHttpRequest.
◆ SetURL()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::SetURL |
( |
const FString & |
URL | ) |
|
|
inlineoverridevirtual |
◆ SetVerb()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::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.
- Parameters
-
Implements IHttpRequest.
◆ Tick()
| void FTransactionallySafeHttpRequest::FClosedHttpRequest::Tick |
( |
float |
DeltaSeconds | ) |
|
|
inlineoverridevirtual |
Used to tick the request
- Parameters
-
| DeltaSeconds | - seconds since last ticked |
Implements IHttpRequest.
The documentation for this class was generated from the following file: