UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IBackgroundHttpRequest Class Referenceabstract

#include <IBackgroundHttpRequest.h>

+ Inheritance diagram for IBackgroundHttpRequest:

Public Member Functions

virtual void SetURLAsList (const TArray< FString > &URLs, int NumRetriesToAttempt)=0
 
virtual const TArray< FString > & GetURLList () const =0
 
virtual void SetExpectedResultSize (const uint64 ExpectedSize)
 
virtual uint64 GetExpectedResultSize () const
 
virtual void SetCompleteNotification (FBackgroundHttpNotificationObjectPtr DownloadCompleteNotificationObject)=0
 
virtual void CompleteWithExistingResponseData (FBackgroundHttpResponsePtr BackgroundResponse)=0
 
virtual FBackgroundHttpRequestCompleteDelegateOnProcessRequestComplete ()=0
 
virtual FBackgroundHttpProgressUpdateDelegateOnProgressUpdated ()=0
 
virtual FBackgroundHttpRequestMetricsDelegateOnRequestMetrics ()=0
 
virtual FBackgroundHttpRequestMetricsExtendedDelegateOnRequestMetricsExtended ()=0
 
virtual void SetMetrics (const int32 TotalBytesDownloaded, const float DownloadDuration)
 
virtual void SetMetricsExtended (const FBackgroundHttpRequestMetricsExtended ExtendedMetrics)
 
virtual bool ProcessRequest ()=0
 
virtual bool HandleDelayedProcess ()=0
 
virtual void CancelRequest ()=0
 
virtual void PauseRequest ()=0
 
virtual void ResumeRequest ()=0
 
virtual const FBackgroundHttpResponsePtr GetResponse () const =0
 
virtual const FString & GetRequestID () const =0
 
virtual void SetRequestID (const FString &NewRequestID)=0
 
virtual EBackgroundHTTPPriority GetRequestPriority () const =0
 
virtual void SetRequestPriority (EBackgroundHTTPPriority NewPriority)=0
 
virtual ~IBackgroundHttpRequest ()=default
 
virtual void GetDebugText (TArray< FString > &Output)
 
- Public Member Functions inherited from TSharedFromThis< IBackgroundHttpRequest, ESPMode::ThreadSafe >
TSharedRef< IBackgroundHttpRequest, Mode > AsShared ()
 
TSharedRef< IBackgroundHttpRequest const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< IBackgroundHttpRequest, Mode > AsWeak ()
 
TWeakPtr< IBackgroundHttpRequest 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
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< IBackgroundHttpRequest, ESPMode::ThreadSafe >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< IBackgroundHttpRequest, ESPMode::ThreadSafe >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

Interface for Http requests (created using FHttpFactory)

Constructor & Destructor Documentation

◆ ~IBackgroundHttpRequest()

virtual IBackgroundHttpRequest::~IBackgroundHttpRequest ( )
virtualdefault

Destructor for overrides

Member Function Documentation

◆ CancelRequest()

virtual void IBackgroundHttpRequest::CancelRequest ( )
pure virtual

Called to cancel a request that is still being processed

Implemented in FBackgroundHttpRequestImpl, and FGenericPlatformBackgroundHttpRequest.

◆ CompleteWithExistingResponseData()

virtual void IBackgroundHttpRequest::CompleteWithExistingResponseData ( FBackgroundHttpResponsePtr  BackgroundResponse)
pure virtual

Function used to complete an IHttpBackgroundRequest from an external source, passing it in a pre-existing response data.

Parameters
BackgroundReponse,ASharedRef to the already existing IHttpBackgroundResponse we want to base this tasks' Response off of.

Implemented in FBackgroundHttpRequestImpl, and FGenericPlatformBackgroundHttpRequest.

◆ GetDebugText()

virtual void IBackgroundHttpRequest::GetDebugText ( TArray< FString > &  Output)
inlinevirtual

Returns debug text for download screen to help troubleshoot download issues

Reimplemented in FApplePlatformBackgroundHttpRequest.

◆ GetExpectedResultSize()

virtual uint64 IBackgroundHttpRequest::GetExpectedResultSize ( ) const
inlinevirtual

Returns expected result size for the request, set by SetExpectedResultSize.

Returns
Expected result size in bytes.

Reimplemented in FBackgroundHttpRequestImpl.

◆ GetRequestID()

virtual const FString & IBackgroundHttpRequest::GetRequestID ( ) const
pure virtual

Gets the associated RequestID for this BackgroundDownload.

Returns
The RequestID

Implemented in FBackgroundHttpRequestImpl.

◆ GetRequestPriority()

virtual EBackgroundHTTPPriority IBackgroundHttpRequest::GetRequestPriority ( ) const
pure virtual

Gets the associated Requeset's Priority for Background Downloadings. Where possible, we attempt to finish downloads in lowest-priority first order.

Returns
The request Priority

Implemented in FBackgroundHttpRequestImpl.

◆ GetResponse()

virtual const FBackgroundHttpResponsePtr IBackgroundHttpRequest::GetResponse ( ) const
pure virtual

Get the associated Response

Returns
the response

Implemented in FBackgroundHttpRequestImpl.

◆ GetURLList()

virtual const TArray< FString > & IBackgroundHttpRequest::GetURLList ( ) const
pure virtual

Gets the current URL List that this background request is currently processing.

Returns
List of URLs as FStrings

Implemented in FBackgroundHttpRequestImpl.

◆ HandleDelayedProcess()

virtual bool IBackgroundHttpRequest::HandleDelayedProcess ( )
pure virtual

Called by certain platform's implementation when we have to wait for the BackgroundHttpManager / PlatformBackgroundHttp to do some work before we can finish our ProcessRequest call. Should only be called by different platform layers.

NOTE: Should really only be called by the BackgroundHttpManager! You are probably looking for ProcessRequest.

Returns
if the request was successfully handled.

Implemented in FBackgroundHttpRequestImpl, and FGenericPlatformBackgroundHttpRequest.

◆ OnProcessRequestComplete()

virtual FBackgroundHttpRequestCompleteDelegate & IBackgroundHttpRequest::OnProcessRequestComplete ( )
pure virtual

Delegate called when the request is complete. See FBackgroundHttpRequestCompleteDelegate

Implemented in FBackgroundHttpRequestImpl.

◆ OnProgressUpdated()

virtual FBackgroundHttpProgressUpdateDelegate & IBackgroundHttpRequest::OnProgressUpdated ( )
pure virtual

Delegate called when the request has a progress update.

Implemented in FBackgroundHttpRequestImpl.

◆ OnRequestMetrics()

virtual FBackgroundHttpRequestMetricsDelegate & IBackgroundHttpRequest::OnRequestMetrics ( )
pure virtual

Delegate called when the request's metrics were calculated

Implemented in FBackgroundHttpRequestImpl.

◆ OnRequestMetricsExtended()

virtual FBackgroundHttpRequestMetricsExtendedDelegate & IBackgroundHttpRequest::OnRequestMetricsExtended ( )
pure virtual

Delegate called when the request's extended metrics were calculated

Implemented in FBackgroundHttpRequestImpl.

◆ PauseRequest()

virtual void IBackgroundHttpRequest::PauseRequest ( )
pure virtual

Called to pause a request that is still being processed

Implemented in FBackgroundHttpRequestImpl, and FApplePlatformBackgroundHttpRequest.

◆ ProcessRequest()

virtual bool IBackgroundHttpRequest::ProcessRequest ( )
pure virtual

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.

Implemented in FBackgroundHttpRequestImpl.

◆ ResumeRequest()

virtual void IBackgroundHttpRequest::ResumeRequest ( )
pure virtual

Called to resume a request that was previously paused

Implemented in FBackgroundHttpRequestImpl, and FApplePlatformBackgroundHttpRequest.

◆ SetCompleteNotification()

virtual void IBackgroundHttpRequest::SetCompleteNotification ( FBackgroundHttpNotificationObjectPtr  DownloadCompleteNotificationObject)
pure virtual

Sets an FHTTPRequestDownloadNotificationObject to be mapped to this HTTPRequest. This request will keep the particular FHttpRequestDownloadNotificationObject reference until it completes. To use this function make sure you keep a reference to the supplied DownloadNotificationObject until you have created all the different IHTTPRequest that you would like to use it. Then delete your reference. Once all references are removed (by each Request completing) a callback set on the DownloadCompleteDelegateObject will be called

Parameters
DownloadCompleteDelegateObjectThe particular download complete delegate object

Implemented in FBackgroundHttpRequestImpl.

◆ SetExpectedResultSize()

virtual void IBackgroundHttpRequest::SetExpectedResultSize ( const uint64  ExpectedSize)
inlinevirtual

Sets expected result size for the request, might be used by the implementation to check file size before invoking completion notification. Must be called before ProcessRequest.

Parameters
ExpectedSizeexpected file size in bytes, 0 to disable the check. Default value is 0.

Reimplemented in FBackgroundHttpRequestImpl.

◆ SetMetrics()

virtual void IBackgroundHttpRequest::SetMetrics ( const int32  TotalBytesDownloaded,
const float  DownloadDuration 
)
inlinevirtual

Set metrics for analytics event

Reimplemented in FBackgroundHttpRequestImpl.

◆ SetMetricsExtended()

virtual void IBackgroundHttpRequest::SetMetricsExtended ( const FBackgroundHttpRequestMetricsExtended  ExtendedMetrics)
inlinevirtual

Set extended metrics for analytics event

Reimplemented in FBackgroundHttpRequestImpl.

◆ SetRequestID()

virtual void IBackgroundHttpRequest::SetRequestID ( const FString &  NewRequestID)
pure virtual

Sets the associated RequestID for this BackgroundDownload. Useful as we associate a background downlaod with multiple URLs, so this provides an easier way to identify the download with 1 string instead of checking multiple URLs.

Parameters
NewRequestIDFString to set the Request ID to.

Implemented in FBackgroundHttpRequestImpl.

◆ SetRequestPriority()

virtual void IBackgroundHttpRequest::SetRequestPriority ( EBackgroundHTTPPriority  NewPriority)
pure virtual

Sets the associated Requeset's Priority for Background Downloadings. Where possible, we attempt to finish downloads in lowest-priority first order.

Parameters
uint32describing priority of this download. Lower happens first and thus 0 is the highest priority.

Implemented in FBackgroundHttpRequestImpl.

◆ SetURLAsList()

virtual void IBackgroundHttpRequest::SetURLAsList ( const TArray< FString > &  URLs,
int  NumRetriesToAttempt 
)
pure virtual

Sets up a list of URLs to automatically fall through as each one fails. Must be called before ProcessRequest.

Parameters
URLslist of URLs. Eg: download.epicgames.com/downloadfilehere.txt, download2.epicgames.com/downloadfilehere.txt, download3.epicgames/downloadfilehere.txt
NumRetriesToAttemptHow many times we want to fall through and try different URLS. Loops back to the beginning of the list if NumRetries > URLs.Num()

Implemented in FBackgroundHttpRequestImpl.


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