2023-10-04 15:14:01 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "GenericPlatform/HttpResponseCommon.h"
|
2023-11-16 21:27:48 -05:00
|
|
|
#include "GenericPlatform/HttpRequestCommon.h"
|
2023-10-04 15:14:01 -04:00
|
|
|
#include "GenericPlatform/GenericPlatformHttp.h"
|
|
|
|
|
|
2024-05-30 15:47:58 -04:00
|
|
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
2023-11-16 21:27:48 -05:00
|
|
|
FHttpResponseCommon::FHttpResponseCommon(const FHttpRequestCommon& HttpRequest)
|
|
|
|
|
: URL(HttpRequest.GetURL())
|
2024-02-05 13:23:49 -05:00
|
|
|
, EffectiveURL(HttpRequest.GetEffectiveURL())
|
2023-11-16 21:27:48 -05:00
|
|
|
, CompletionStatus(HttpRequest.GetStatus())
|
2023-12-05 17:39:04 -05:00
|
|
|
, FailureReason(HttpRequest.GetFailureReason())
|
2023-10-04 15:14:01 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
2023-11-16 21:27:48 -05:00
|
|
|
|
2024-02-05 13:23:49 -05:00
|
|
|
const FString& FHttpResponseCommon::GetEffectiveURL() const
|
|
|
|
|
{
|
|
|
|
|
return EffectiveURL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-16 21:27:48 -05:00
|
|
|
void FHttpResponseCommon::SetRequestStatus(EHttpRequestStatus::Type InCompletionStatus)
|
|
|
|
|
{
|
|
|
|
|
CompletionStatus = InCompletionStatus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EHttpRequestStatus::Type FHttpResponseCommon::GetStatus() const
|
|
|
|
|
{
|
|
|
|
|
return CompletionStatus;
|
|
|
|
|
}
|
2023-12-05 17:39:04 -05:00
|
|
|
|
|
|
|
|
void FHttpResponseCommon::SetRequestFailureReason(EHttpFailureReason InFailureReason)
|
|
|
|
|
{
|
|
|
|
|
FailureReason = InFailureReason;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EHttpFailureReason FHttpResponseCommon::GetFailureReason() const
|
|
|
|
|
{
|
|
|
|
|
return FailureReason;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-05 13:23:49 -05:00
|
|
|
void FHttpResponseCommon::SetEffectiveURL(const FString& InEffectiveURL)
|
|
|
|
|
{
|
|
|
|
|
EffectiveURL = InEffectiveURL;
|
|
|
|
|
}
|
2024-06-25 14:09:55 -04:00
|
|
|
|
|
|
|
|
int32 FHttpResponseCommon::GetResponseCode() const
|
|
|
|
|
{
|
|
|
|
|
return ResponseCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FHttpResponseCommon::SetResponseCode(int32 InResponseCode)
|
|
|
|
|
{
|
|
|
|
|
ResponseCode = InResponseCode;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-30 15:47:58 -04:00
|
|
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|