UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGenericPlatformHttp Class Reference

#include <GenericPlatformHttp.h>

+ Inheritance diagram for FGenericPlatformHttp:

Static Public Member Functions

static HTTP_API void Init ()
 
static FHttpManagerCreatePlatformHttpManager ()
 
static HTTP_API void Shutdown ()
 
static void ShutdownPlatformCustomSsl ()
 
static HTTP_API IHttpRequestConstructRequest ()
 
static HTTP_API FString UrlEncode (const FStringView UnencodedString)
 
static HTTP_API FString UrlDecode (const FStringView EncodedString)
 
static HTTP_API FString HtmlEncode (const FStringView UnencodedString)
 
static HTTP_API FString GetUrlDomainAndPort (const FStringView Url)
 
static HTTP_API FString GetUrlDomain (const FStringView Url)
 
static HTTP_API FString GetUrlBase (const FStringView Url)
 
static HTTP_API FString GetMimeType (const FString &FilePath)
 
static HTTP_API FString GetDefaultUserAgent ()
 
static HTTP_API FString EscapeUserAgentString (const FString &UnescapedString)
 
static HTTP_API void AddDefaultUserAgentProjectComment (const FString &Comment)
 
static HTTP_API void AddDefaultUserAgentPlatformComment (const FString &Comment)
 
static HTTP_API uint32 GetDefaultUserAgentVersion ()
 
static HTTP_API FDefaultUserAgentBuilder GetDefaultUserAgentBuilder ()
 
static HTTP_API TOptional< FString > GetOperatingSystemProxyAddress ()
 
static HTTP_API bool IsOperatingSystemProxyInformationSupported ()
 
static HTTP_API bool IsURLEncoded (const TArray< uint8 > &Payload)
 
static HTTP_API TOptional< FString > GetUrlParameter (const FStringView Url, const FStringView ParameterName)
 
static HTTP_API TOptional< uint16GetUrlPort (const FStringView Url)
 
static HTTP_API FString GetUrlPath (const FStringView Url, const bool bIncludeQueryString=false, const bool bIncludeFragment=false)
 
static HTTP_API TOptional< boolIsSecureProtocol (const FStringView Url)
 

Detailed Description

Platform specific Http implementations Intended usage is to use FPlatformHttp instead of FGenericPlatformHttp

Member Function Documentation

◆ AddDefaultUserAgentPlatformComment()

void FGenericPlatformHttp::AddDefaultUserAgentPlatformComment ( const FString &  Comment)
static

Add a comment to be included in the platform section of the default User-Agent string.

◆ AddDefaultUserAgentProjectComment()

void FGenericPlatformHttp::AddDefaultUserAgentProjectComment ( const FString &  Comment)
static

Add a comment to be included in the project section of the default User-Agent string.

◆ ConstructRequest()

IHttpRequest * FGenericPlatformHttp::ConstructRequest ( )
static

Creates a new Http request instance for the current platform

Returns
request object

◆ CreatePlatformHttpManager()

static FHttpManager * FGenericPlatformHttp::CreatePlatformHttpManager ( )
inlinestatic

Creates a platform-specific HTTP manager.

Returns
nullptr if default implementation is to be used

◆ EscapeUserAgentString()

FString FGenericPlatformHttp::EscapeUserAgentString ( const FString &  UnescapedString)
static

◆ GetDefaultUserAgent()

FString FGenericPlatformHttp::GetDefaultUserAgent ( )
static

Returns the default User-Agent string to use in HTTP requests. Requests that explicitly set the User-Agent header will not use this value.

The default User-Agent is built in the format "project/version (comments) platform/OS version (comments)"

Returns
the default User-Agent string that requests should use.

◆ GetDefaultUserAgentBuilder()

FDefaultUserAgentBuilder FGenericPlatformHttp::GetDefaultUserAgentBuilder ( )
static

Gets a copy of the values used to build the default user agent string. Used for modifying default user agent values before sending HTTP requests.

◆ GetDefaultUserAgentVersion()

uint32 FGenericPlatformHttp::GetDefaultUserAgentVersion ( )
static

Get the version of the default user agent. The version is incremented any time the default user agent is changed. Used to invalidate any cached user agent value.

Returns
the current version of the default user agent.

◆ GetMimeType()

FString FGenericPlatformHttp::GetMimeType ( const FString &  FilePath)
static

Get the mime type for the file

Returns
the mime type for the file.

◆ GetOperatingSystemProxyAddress()

TOptional< FString > FGenericPlatformHttp::GetOperatingSystemProxyAddress ( )
static

Utility for escaping a string used in the HTTP user agent. Removes disallowed characters.

Returns
the escaped string. Get the proxy address specified by the operating system
optional FString: If unset: we are unable to get information from the operating system. If set: the proxy address set by the operating system (may be blank)

◆ GetUrlBase()

FString FGenericPlatformHttp::GetUrlBase ( const FStringView  Url)
static

Returns the base of the URL, e.g., "http://a.b.c:d" of "http://a.b.c:d/e"

Parameters
Urlthe URL to return the base of
Returns
the base of the specified URL

◆ GetUrlDomain()

FString FGenericPlatformHttp::GetUrlDomain ( const FStringView  Url)
static

Returns the domain portion of the URL, e.g., "a.b.c" of "http://a.b.c:d/e"

Parameters
Urlthe URL to return the domain of
Returns
the domain of the specified URL

◆ GetUrlDomainAndPort()

FString FGenericPlatformHttp::GetUrlDomainAndPort ( const FStringView  Url)
static

Returns the domain and port portion of the URL, e.g., "a.b.c:d" of "http://a.b.c:d/e"

Parameters
Urlthe URL to return the domain and port of
Returns
the domain and port of the specified URL

◆ GetUrlParameter()

TOptional< FString > FGenericPlatformHttp::GetUrlParameter ( const FStringView  Url,
const FStringView  ParameterName 
)
static

Extract the URL-Decoded value of the specified ParameterName from Url. An unset return means the parameter was not present in Url, while an empty value means it was present, but had no value.

Parameters
UrlThe URL to parse for ParameterName
ParameterNameThe parameter name to look for
Returns
If ParameterName was found, the string value of its value (in URL Decoded format), otherwise the return value is unset

◆ GetUrlPath()

FString FGenericPlatformHttp::GetUrlPath ( const FStringView  Url,
const bool  bIncludeQueryString = false,
const bool  bIncludeFragment = false 
)
static

Extract the Path portion of a URL, optionally including the Query String, and optionally including the Fragment (when also including the query string.) The return value will always contain a leading forward slash, even if no path is found. If bIncludeFragment is set true, bIncludeQueryString must also be true

Parameters
UrlThe URL to parse for a Path
bIncludeQueryStringinclude the URL's query string in the return value (if one is found)
bIncludeFragmentinclude the URL's fragement in the return value (if one is found)

◆ GetUrlPort()

TOptional< uint16 > FGenericPlatformHttp::GetUrlPort ( const FStringView  Url)
static

Extract the Port part of a URL, or an unset object if there was non specified. Example: "http://example.org:23/" would return 23, while "https://example.org/" would return an unset object

Parameters
UrlThe URL to parse for a Port

◆ HtmlEncode()

FString FGenericPlatformHttp::HtmlEncode ( const FStringView  UnencodedString)
static

Returns the < &gt...etc encoding for strings between HTML elements.

Parameters
UnencodedStringThe unencoded string to convert to html encoding.
Returns
The html encoded string

◆ Init()

void FGenericPlatformHttp::Init ( )
static

Platform initialization step

◆ IsOperatingSystemProxyInformationSupported()

bool FGenericPlatformHttp::IsOperatingSystemProxyInformationSupported ( )
static

Check if getting proxy information from the current operating system is supported Useful for "Network Settings" type pages. GetProxyAddress may return an empty or populated string but that does not imply the operating system does or does not support proxies (or that it has been implemented here)

Returns
true if we are able to get proxy information from the current operating system, false if not

◆ IsSecureProtocol()

TOptional< bool > FGenericPlatformHttp::IsSecureProtocol ( const FStringView  Url)
static

Check the protocol of the provided URL to determine if this is for a secure connection (HTTPS, WSS, etc)

Parameters
TheURL to check for a scheme
Returns
True if secure, false if insecure, unset if unknown

◆ IsURLEncoded()

bool FGenericPlatformHttp::IsURLEncoded ( const TArray< uint8 > &  Payload)
static

Helper function for checking if a byte array is in URL encoded format.

◆ Shutdown()

void FGenericPlatformHttp::Shutdown ( )
static

Platform shutdown step

◆ ShutdownPlatformCustomSsl()

static void FGenericPlatformHttp::ShutdownPlatformCustomSsl ( )
inlinestatic

Platform shutdown custom ssl if supported

◆ UrlDecode()

FString FGenericPlatformHttp::UrlDecode ( const FStringView  EncodedString)
static

Returns a decoded version of the percent-encoded passed in string

Parameters
EncodedStringThe percent encoded string to convert to string
Returns
The decoded string

◆ UrlEncode()

FString FGenericPlatformHttp::UrlEncode ( const FStringView  UnencodedString)
static

Returns a percent-encoded version of the passed in string

Parameters
UnencodedStringThe unencoded string to convert to percent-encoding
Returns
The percent-encoded string

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