UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GenericPlatformBackgroundHttpRequest.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "HAL/Platform.h"
11#include "Templates/UniquePtr.h"
12
13
19{
20public:
21
24
25 //IHttpBackgroundHttpRequest
26 BACKGROUNDHTTP_API virtual bool HandleDelayedProcess() override;
28 BACKGROUNDHTTP_API virtual void CancelRequest() override;
29
30protected:
31 //In the default implementation we actually use HTTPRequests instead of HttpBackgroundRequests.
32 //This class handles wrapping some of the HttpBackgroundRequest only functionality (such as request lists
33 //and notification objects) so they work with non-background HttpRequests
35 {
36 public:
39
40 void MakeRequest();
42
43 private:
44
45 bool HasRetriesRemaining() const;
46 void UpdateHttpProgress(FHttpRequestPtr UnderlyingHttpRequest, uint64 BytesSent, uint64 BytesReceived);
47
48 void CleanUpHttpRequest();
49
50 // Gets the current URL the HTTP Request should use by comparing the URLList in the background request to the current retry number.
51 // Returns empty FString if we are "out of" retries (CurrentRetryNumber > MaxRetries) or if no valid URL.
52 const FString GetURLForCurrentRetryNumber();
53
54 //Don't want to provide default implementation. Must provide an IHttpBackgroundRequest to wrap in public constructor
56
57 //Reference to the creating request
59
60 //Current Http Request being processed by this wrapper
62
63 //Tracking retry number we are currently on
64 int32 CurrentRetryNumber;
65
66 //Max number of retries we should do
67 int32 MaxRetries;
68
69 //How many bytes we had last time we sent progress updates
70 uint64 LastProgressUpdateBytes;
71 };
72
74};
bool bSuccess
Definition ConvexDecomposition3.cpp:819
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition BackgroundHttpRequestImpl.h:20
Definition GenericPlatformBackgroundHttpRequest.h:35
void MakeRequest()
Definition GenericPlatformBackgroundHttpRequest.cpp:68
~FGenericPlatformBackgroundHttpWrapper()
Definition GenericPlatformBackgroundHttpRequest.cpp:63
void HttpRequestComplete(FHttpRequestPtr HttpRequestIn, FHttpResponsePtr HttpResponse, bool bSuccess)
Definition GenericPlatformBackgroundHttpRequest.cpp:140
Definition GenericPlatformBackgroundHttpRequest.h:19
virtual BACKGROUNDHTTP_API void CompleteWithExistingResponseData(FBackgroundHttpResponsePtr BackgroundResponse) override
TUniquePtr< FGenericPlatformBackgroundHttpWrapper > RequestWrapper
Definition GenericPlatformBackgroundHttpRequest.h:73
virtual BACKGROUNDHTTP_API bool HandleDelayedProcess() override
Definition GenericPlatformBackgroundHttpRequest.cpp:20
virtual BACKGROUNDHTTP_API void CancelRequest() override
Definition GenericPlatformBackgroundHttpRequest.cpp:41
BACKGROUNDHTTP_API FGenericPlatformBackgroundHttpRequest()
Definition GenericPlatformBackgroundHttpRequest.cpp:10
virtual BACKGROUNDHTTP_API ~FGenericPlatformBackgroundHttpRequest()
Definition GenericPlatformBackgroundHttpRequest.cpp:15
Definition UniquePtr.h:107
Definition SharedPointer.h:1295