Files
UnrealEngineUWP/Engine/Source/Runtime/Online/HTTP/Private/GenericPlatform/HttpResponseCommon.cpp
lorry li f1f1946eee Add GetEffectiveURL interface to get the effective url after redirection.
#jira UE-204044
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina [at]jens.petersam
#rb Rafa.Lecina
#tests Passed WebTests test case, launched the game to main menu.

[CL 31180593 by lorry li in ue5-main branch]
2024-02-05 13:23:49 -05:00

59 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "GenericPlatform/HttpResponseCommon.h"
#include "GenericPlatform/HttpRequestCommon.h"
#include "GenericPlatform/GenericPlatformHttp.h"
FHttpResponseCommon::FHttpResponseCommon(const FHttpRequestCommon& HttpRequest)
: URL(HttpRequest.GetURL())
, EffectiveURL(HttpRequest.GetEffectiveURL())
, CompletionStatus(HttpRequest.GetStatus())
, FailureReason(HttpRequest.GetFailureReason())
{
}
FString FHttpResponseCommon::GetURLParameter(const FString& ParameterName) const
{
FString ReturnValue;
if (TOptional<FString> OptionalParameterValue = FGenericPlatformHttp::GetUrlParameter(URL, ParameterName))
{
ReturnValue = MoveTemp(OptionalParameterValue.GetValue());
}
return ReturnValue;
}
FString FHttpResponseCommon::GetURL() const
{
return URL;
}
const FString& FHttpResponseCommon::GetEffectiveURL() const
{
return EffectiveURL;
}
void FHttpResponseCommon::SetRequestStatus(EHttpRequestStatus::Type InCompletionStatus)
{
CompletionStatus = InCompletionStatus;
}
EHttpRequestStatus::Type FHttpResponseCommon::GetStatus() const
{
return CompletionStatus;
}
void FHttpResponseCommon::SetRequestFailureReason(EHttpFailureReason InFailureReason)
{
FailureReason = InFailureReason;
}
EHttpFailureReason FHttpResponseCommon::GetFailureReason() const
{
return FailureReason;
}
void FHttpResponseCommon::SetEffectiveURL(const FString& InEffectiveURL)
{
EffectiveURL = InEffectiveURL;
}