Files
UnrealEngine/Engine/Source/Runtime/StorageServerClient/Private/StorageServerHttpClient.h
2025-05-18 13:04:45 +08:00

53 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
#include "IO/IoBuffer.h"
#include "IO/IoStatus.h"
#include "Misc/Optional.h"
#if !UE_BUILD_SHIPPING
enum class EStorageServerContentType : uint8
{
Unknown = 0,
CbObject,
Binary,
CompressedBinary,
};
class IStorageServerHttpClient
{
public:
using FResult = TTuple<TIoStatusOr<FIoBuffer>, EStorageServerContentType>;
using FResultCallback = TFunction<void(FResult)>;
virtual ~IStorageServerHttpClient() = default;
virtual FResult RequestSync(
FAnsiStringView Url,
EStorageServerContentType Accept = EStorageServerContentType::Unknown,
FAnsiStringView Verb = "GET",
TOptional<FIoBuffer> OptPayload = TOptional<FIoBuffer>(),
EStorageServerContentType PayloadContentType = EStorageServerContentType::Unknown,
TOptional<FIoBuffer> OptDestination = TOptional<FIoBuffer>(),
float TimeoutSeconds = -1.f,
const bool bReportErrors = true
) = 0;
virtual void RequestAsync(
FResultCallback&& Callback,
FAnsiStringView Url,
EStorageServerContentType Accept = EStorageServerContentType::Unknown,
FAnsiStringView Verb = "GET",
TOptional<FIoBuffer> OptPayload = TOptional<FIoBuffer>(),
EStorageServerContentType PayloadContentType = EStorageServerContentType::Unknown,
TOptional<FIoBuffer> OptDestination = TOptional<FIoBuffer>(),
float TimeoutSeconds = -1.f,
const bool bReportErrors = true
) = 0;
};
#endif