Navigation
API > API/Runtime > API/Runtime/HTTP > API/Runtime/HTTP/GenericPlatform
Inheritance Hierarchy
- IHttpBase
- TSharedFromThis
- IHttpRequest
- FHttpRequestImpl
- FHttpRequestCommon
References
| Module | HTTP |
| Header | /Engine/Source/Runtime/Online/HTTP/Public/GenericPlatform/HttpRequestCommon.h |
| Include | #include "GenericPlatform/HttpRequestCommon.h" |
Syntax
class FHttpRequestCommon : public FHttpRequestImpl
Remarks
Contains implementation of some common functions that don't vary between implementations of different platforms
Variables
| Type | Name | Description | |
|---|---|---|---|
| double | ActivityTimeoutAt | Record when this request will activity timeout | |
| TSharedPtr< IHttpTaskTimerHandle > | ActivityTimeoutHttpTaskTimerHandle | Holder the timer handle, if the request get destroyed before triggering the timeout, use this to remove the timer | |
| TOptional< float > | ActivityTimeoutSecs | Timeout in seconds for the HTTP request activity timeout | |
| std::atomic< bool > | bActivityTimedOut | Indicate the request is activity timed out, it should quit and fail with EHttpFailureReason::ConnectionError | |
| std::atomic< bool > | bCanceled | Indicate the request is cancelled, it should quit and fail with EHttpFailureReason::Cancelled | |
| std::atomic< bool > | bInitializedWithValidStream | Flag to indicate the request was initialized with stream. | |
| std::atomic< bool > | bTimedOut | Indicate the request is timed out, it should quit and fail with EHttpFailureReason::TimedOut | |
| bool | bUsePlatformActivityTimeout | TODO: Move this feature into CurlHttp | |
| EHttpRequestStatus::Type | CompletionStatus | Current status of request being processed | |
| double | ConnectTime | Record how long it take to connect to the endpoint | |
| EHttpRequestDelegateThreadPolicy | DelegateThreadPolicy | Thread policy about which thread to complete this request | |
| FString | EffectiveURL | Cache the effective URL. When redirected, it will be different with original URL | |
| EHttpFailureReason | FailureReason | Reason of failure of the HTTP request | |
| FCriticalSection | HttpTaskTimerHandleCriticalSection | Critical section for accessing HttpTaskTimerHandle | |
| TUniquePtr< FRequestPayload > | RequestPayload | Payload to use with the request. Typically for POST, PUT, or PATCH | |
| double | RequestStartTimeAbsoluteSeconds | Record when this request started | |
| TSharedPtr< FArchive > | ResponseBodyReceiveStream | The stream to receive response body | |
| FCriticalSection | ResponseBodyReceiveStreamCriticalSection | Critical section for accessing ResponseBodyReceiveStream | |
| TSharedPtr< FHttpResponseCommon > | ResponseCommon | The response object which we will use to pair with this request | |
| double | StartProcessTime | Record when the request start to process | |
| TOptional< float > | TimeoutSecs | Timeout in seconds for the entire HTTP request to complete | |
| TSharedPtr< IHttpTaskTimerHandle > | TotalTimeoutHttpTaskTimerHandle | Holder the timer handle, if the request get destroyed before triggering the timeout, use this to remove the timer |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AbortRequest () |
||
| void | |||
| void | |||
| void | |||
| void | Can be called on game thread or http thread depend on the delegate thread policy. | ||
| void | Finish the request when it's not in http manager | ||
| float | |||
| float | |||
| void | HandleRequestSucceed
(
TSharedPtr< IHttpResponse > InResponse |
||
| void | |||
| void | |||
| bool | |||
| bool | PassReceivedDataToStream
(
void* Ptr, |
||
| void | PostProcess () |
||
| bool | PreCheck () |
||
| bool | PreProcess () |
Check if this request is valid or allowed, before actually process the request | |
| void | ResetActivityTimeoutTimer
(
FStringView Reason |
||
| bool | SetContentAsStreamedFileDefaultImpl
(
const FString& Filename |
||
| void | SetEffectiveURL
(
const FString& InEffectiveURL |
||
| void | SetFailureReason
(
EHttpFailureReason InFailureReason |
||
| void | SetStatus
(
EHttpRequestStatus::Type InCompletionStatus |
||
| bool | SetupRequest () |
||
| void | |||
| void | StartActivityTimeoutTimerBy
(
double DelayToTrigger |
||
| void | |||
| void | |||
| void | |||
| void | |||
| void | TriggerStatusCodeReceivedDelegate
(
int32 StatusCode |
Overridden from FHttpRequestImpl
| Type | Name | Description | |
|---|---|---|---|
| void | Shutdown () |
Clear callbacks before http module get deleted |
Overridden from IHttpRequest
| Type | Name | Description | |
|---|---|---|---|
| void | Called to cancel a request that is still being processed | ||
| void | ClearTimeout () |
Clears the optional timeout in seconds for this HTTP request, causing the default value from FHttpModule::GetTimeout() to be used. | |
| EHttpRequestDelegateThreadPolicy | Get thread policy about which thread to complete this request | ||
| const FHttpResponsePtr | GetResponse () |
Get the associated Response | |
| TOptional< float > | GetTimeout () |
Gets the optional timeout in seconds for this entire HTTP request to complete. | |
| void | Blocking call to wait the request until it's completed | ||
| void | SetActivityTimeout
(
float InTimeoutSecs |
Sets an optional activity timeout in seconds for this HTTP request. | |
| void | SetDelegateThreadPolicy
(
EHttpRequestDelegateThreadPolicy InThreadPolicy |
Set thread policy about which thread to trigger the delegates, set by FHttpManager::SetRequestCompletedDelegate, IHttpRequest::OnStatusCodeReceived, IHttpRequest::OnHeaderReceived, IHttpRequest::OnRequestProgress64 and IHttpRequest::OnProcessRequestComplete. | |
| bool | SetResponseBodyReceiveStream
(
TSharedRef< FArchive > Stream |
Sets the stream to receive the response body. | |
| void | SetTimeout
(
float InTimeoutSecs |
Sets an optional timeout in seconds for this entire HTTP request to complete. |
Overridden from IHttpBase
| Type | Name | Description | |
|---|---|---|---|
| const FString & | Get the effective URL in case of redirected. If not redirected, it's the same as GetURL | ||
| EHttpFailureReason | Get the reason of th failure if GetStatus returns Failed | ||
| EHttpRequestStatus::Type | GetStatus () |
IHttpRequest. | |
| FString | GetURLParameter
(
const FString& ParameterName |
IHttpBase. |