Files
UnrealEngineUWP/Engine/Source/Runtime/Online/HTTP/Public/Interfaces/IHttpBase.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

73 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
/**
* Base interface for Http Requests and Responses.
*/
class IHttpBase
{
public:
/**
* Get the URL used to send the request.
*
* @return the URL string.
*/
virtual FString GetURL() const = 0;
/**
* Gets an URL parameter.
* expected format is ?Key=Value&Key=Value...
* If that format is not used, this function will not work.
*
* @param ParameterName - the parameter to request.
* @return the parameter value string.
*/
virtual FString GetURLParameter(const FString& ParameterName) const = 0;
/**
* Gets the value of a header, or empty string if not found.
*
* @param HeaderName - name of the header to set.
*/
virtual FString GetHeader(const FString& HeaderName) const = 0;
/**
* Return all headers in an array in "Name: Value" format.
*
* @return the header array of strings
*/
virtual TArray<FString> GetAllHeaders() const = 0;
/**
* Shortcut to get the Content-Type header value (if available)
*
* @return the content type.
*/
virtual FString GetContentType() const = 0;
/**
* Shortcut to get the Content-Length header value. Will not always return non-zero.
* If you want the real length of the payload, get the payload and check it's length.
*
* @return the content length (if available)
*/
virtual int32 GetContentLength() const = 0;
/**
* Get the content payload of the request or response.
*
* @param Content - array that will be filled with the content.
*/
virtual const TArray<uint8>& GetContent() const = 0;
/**
* Destructor for overrides
*/
virtual ~IHttpBase() = default;
};