A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
UVaRestRequestJSON Class ReferenceBlueprintTypeBlueprintable

UCLASS(BlueprintType, Blueprintable) More...

#include <VaRestRequestJSON.h>

Inheritance diagram for UVaRestRequestJSON:
[legend]

Public Member Functions

void AddTag (FName Tag)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")
 
virtual void ApplyURL (const FString &Url, UVaRestJsonObject *&Result, UObject *WorldContextObject, struct FLatentActionInfo LatentInfo)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request", meta = (Latent, LatentInfo = "LatentInfo", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
 
void Cancel ()
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
virtual void ExecuteProcessRequest ()
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
TArray< FString > GetAllResponseHeaders () const
 UFUNCTION(BlueprintPure, Category = "VaRest|Response")
 
TSharedRef< IHttpRequest, ESPMode::ThreadSafe > GetHttpRequest () const
 
UVaRestJsonObjectGetRequestObject () const
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
int32 GetResponseCode () const
 UFUNCTION(BlueprintPure, Category = "VaRest|Response")
 
FString GetResponseContentAsString (bool bCacheResponseContent=true)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
FString GetResponseHeader (const FString &HeaderName)
 UFUNCTION(BlueprintPure, Category = "VaRest|Response")
 
UVaRestJsonObjectGetResponseObject () const
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
UVaRestJsonValueGetResponseValue () const
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
EVaRestRequestStatus GetStatus () const
 UFUNCTION(BlueprintPure, Category = "VaRest|Request")
 
FString GetURL () const
 UFUNCTION(BlueprintPure, Category = "VaRest|Request")
 
EVaRestRequestVerb GetVerb () const
 UFUNCTION(BlueprintPure, Category = "VaRest|Request")
 
bool HasTag (FName Tag) const
 UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")
 
virtual void ProcessURL (const FString &Url=TEXT("http://alyamkin.com"))
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
int32 RemoveTag (FName Tag)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")
 
void ResetData ()
 UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")
 
void ResetRequestData ()
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void ResetResponseData ()
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
void SetBinaryContentType (const FString &ContentType)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetBinaryRequestContent (const TArray< uint8 > &Content)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetContentType (EVaRestRequestContentType ContentType)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetCustomVerb (FString Verb)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetHeader (const FString &HeaderName, const FString &HeaderValue)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetRequestObject (UVaRestJsonObject *JsonObject)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetResponseObject (UVaRestJsonObject *JsonObject)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
 
void SetStringRequestContent (const FString &Content)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetURL (const FString &Url=TEXT("http://alyamkin.com"))
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 
void SetVerb (EVaRestRequestVerb Verb)
 UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
 

Public Attributes

bool bIsValidJsonResponse
 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
 
FOnRequestComplete OnRequestComplete
 UPROPERTY(BlueprintAssignable, Category = "VaRest|Event")
 
FOnRequestFail OnRequestFail
 UPROPERTY(BlueprintAssignable, Category = "VaRest|Event")
 
FOnStaticRequestComplete OnStaticRequestComplete
 
FOnStaticRequestFail OnStaticRequestFail
 
FString ResponseContent
 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
 
int32 ResponseSize
 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
 

Protected Member Functions

void ProcessRequest ()
 

Protected Attributes

FString BinaryContentType
 
FVaRestLatentAction< UVaRestJsonObject * > * ContinueAction
 
FString CustomVerb
 
TSharedRef< IHttpRequest, ESPMode::ThreadSafe > HttpRequest = FHttpModule::Get().CreateRequest()
 
TArray< uint8 > RequestBytes
 
EVaRestRequestContentType RequestContentType
 
TMap< FString, FString > RequestHeaders
 
UVaRestJsonObjectRequestJsonObj
 UPROPERTY()
 
EVaRestRequestVerb RequestVerb
 
int32 ResponseCode
 
TMap< FString, FString > ResponseHeaders
 
UVaRestJsonObjectResponseJsonObj
 UPROPERTY()
 
UVaRestJsonValueResponseJsonValue
 UPROPERTY()
 
FString StringRequestContent
 
TArray< FName > Tags
 

Static Protected Attributes

static FString DeprecatedResponseString
 

Private Member Functions

 GENERATED_UCLASS_BODY ()
 
void OnProcessRequestComplete (FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
 

Detailed Description

UCLASS(BlueprintType, Blueprintable)

General helper class http requests via blueprints

Definition at line 90 of file VaRestRequestJSON.h.

Member Function Documentation

◆ AddTag()

void UVaRestRequestJSON::AddTag ( FName Tag)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")

Add tag to this request

Definition at line 566 of file VaRestRequestJSON.cpp.

◆ ApplyURL()

void UVaRestRequestJSON::ApplyURL ( const FString & Url,
UVaRestJsonObject *& Result,
UObject * WorldContextObject,
struct FLatentActionInfo LatentInfo )
virtualBlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request", meta = (Latent, LatentInfo = "LatentInfo", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))

Open URL in latent mode

Definition at line 251 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:

◆ Cancel()

void UVaRestRequestJSON::Cancel ( )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Cancel latent response waiting

Definition at line 135 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:

◆ ExecuteProcessRequest()

void UVaRestRequestJSON::ExecuteProcessRequest ( )
virtualBlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Check URL and execute process request

Definition at line 279 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GENERATED_UCLASS_BODY()

UVaRestRequestJSON::GENERATED_UCLASS_BODY ( )
private

◆ GetAllResponseHeaders()

TArray< FString > UVaRestRequestJSON::GetAllResponseHeaders ( ) const
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Response")

Get list of all response headers

Definition at line 221 of file VaRestRequestJSON.cpp.

◆ GetHttpRequest()

TSharedRef< IHttpRequest, ESPMode::ThreadSafe > UVaRestRequestJSON::GetHttpRequest ( ) const
inline

Returns reference to internal request object

Definition at line 454 of file VaRestRequestJSON.h.

◆ GetRequestObject()

UVaRestJsonObject * UVaRestRequestJSON::GetRequestObject ( ) const
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Get the Request Json object

Definition at line 145 of file VaRestRequestJSON.cpp.

◆ GetResponseCode()

int32 UVaRestRequestJSON::GetResponseCode ( ) const
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Response")

Get the response code of the last query

Definition at line 203 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ GetResponseContentAsString()

FString UVaRestRequestJSON::GetResponseContentAsString ( bool bCacheResponseContent = true)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Get request response stored as a string

Parameters
bCacheResponseContent- Set true if you plan to use it few times to prevent deserialization each time

Definition at line 587 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:

◆ GetResponseHeader()

FString UVaRestRequestJSON::GetResponseHeader ( const FString & HeaderName)
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Response")

Get value of desired response header

Definition at line 208 of file VaRestRequestJSON.cpp.

◆ GetResponseObject()

UVaRestJsonObject * UVaRestRequestJSON::GetResponseObject ( ) const
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Get the Response Json object

Definition at line 162 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ GetResponseValue()

UVaRestJsonValue * UVaRestRequestJSON::GetResponseValue ( ) const
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Get the Response Json value

Definition at line 179 of file VaRestRequestJSON.cpp.

◆ GetStatus()

EVaRestRequestStatus UVaRestRequestJSON::GetStatus ( ) const
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Request")

Get status of http request

Definition at line 198 of file VaRestRequestJSON.cpp.

◆ GetURL()

FString UVaRestRequestJSON::GetURL ( ) const
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Request")

Get url of http request

Definition at line 188 of file VaRestRequestJSON.cpp.

◆ GetVerb()

EVaRestRequestVerb UVaRestRequestJSON::GetVerb ( ) const
BlueprintPure

UFUNCTION(BlueprintPure, Category = "VaRest|Request")

Get verb to the request

Definition at line 193 of file VaRestRequestJSON.cpp.

◆ HasTag()

bool UVaRestRequestJSON::HasTag ( FName Tag) const
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")

See if this request contains the supplied tag

Definition at line 579 of file VaRestRequestJSON.cpp.

◆ OnProcessRequestComplete()

void UVaRestRequestJSON::OnProcessRequestComplete ( FHttpRequestPtr Request,
FHttpResponsePtr Response,
bool bWasSuccessful )
private

Internal bind function for the IHTTPRequest::OnProcessRequestCompleted() event

Definition at line 468 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessRequest()

void UVaRestRequestJSON::ProcessRequest ( )
protected

Apply current internal setup to request and process it

Definition at line 290 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessURL()

void UVaRestRequestJSON::ProcessURL ( const FString & Url = TEXT("http://alyamkin.com"))
virtualBlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Open URL with current setup

Definition at line 245 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveTag()

int32 UVaRestRequestJSON::RemoveTag ( FName Tag)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")

Remove tag from this request

Returns
Number of removed elements

Definition at line 574 of file VaRestRequestJSON.cpp.

◆ ResetData()

void UVaRestRequestJSON::ResetData ( )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Utility")

Reset all internal saved data

Definition at line 81 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:

◆ ResetRequestData()

void UVaRestRequestJSON::ResetRequestData ( )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Reset saved request data

Definition at line 87 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetResponseData()

void UVaRestRequestJSON::ResetResponseData ( )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Reset saved response data

Definition at line 105 of file VaRestRequestJSON.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBinaryContentType()

void UVaRestRequestJSON::SetBinaryContentType ( const FString & ContentType)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set content type of the request for binary post data

Definition at line 58 of file VaRestRequestJSON.cpp.

◆ SetBinaryRequestContent()

void UVaRestRequestJSON::SetBinaryRequestContent ( const TArray< uint8 > & Content)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set content of the request for binary post data

Definition at line 63 of file VaRestRequestJSON.cpp.

◆ SetContentType()

void UVaRestRequestJSON::SetContentType ( EVaRestRequestContentType ContentType)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set content type to the request. If you're using the x-www-form-urlencoded, params/constaints should be defined as key=ValueString pairs from Json data

Definition at line 53 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ SetCustomVerb()

void UVaRestRequestJSON::SetCustomVerb ( FString Verb)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set custom verb to the request

Definition at line 48 of file VaRestRequestJSON.cpp.

◆ SetHeader()

void UVaRestRequestJSON::SetHeader ( const FString & HeaderName,
const FString & HeaderValue )
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Sets optional header info

Definition at line 73 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ SetRequestObject()

void UVaRestRequestJSON::SetRequestObject ( UVaRestJsonObject * JsonObject)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set the Request Json object

Definition at line 151 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ SetResponseObject()

void UVaRestRequestJSON::SetResponseObject ( UVaRestJsonObject * JsonObject)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Response")

Set the Response Json object

Definition at line 168 of file VaRestRequestJSON.cpp.

◆ SetStringRequestContent()

void UVaRestRequestJSON::SetStringRequestContent ( const FString & Content)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set content of the request as a plain string

Definition at line 68 of file VaRestRequestJSON.cpp.

◆ SetURL()

void UVaRestRequestJSON::SetURL ( const FString & Url = TEXT("http://alyamkin.com"))
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Setting request URL

Definition at line 234 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

◆ SetVerb()

void UVaRestRequestJSON::SetVerb ( EVaRestRequestVerb Verb)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "VaRest|Request")

Set verb to the request

Definition at line 43 of file VaRestRequestJSON.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ BinaryContentType

FString UVaRestRequestJSON::BinaryContentType
protected

Definition at line 413 of file VaRestRequestJSON.h.

◆ bIsValidJsonResponse

bool UVaRestRequestJSON::bIsValidJsonResponse
BlueprintReadOnlyVisibleAnywhere

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")

Is the response valid JSON?

Definition at line 396 of file VaRestRequestJSON.h.

◆ ContinueAction

FVaRestLatentAction<UVaRestJsonObject*>* UVaRestRequestJSON::ContinueAction
protected

Latent action helper

Definition at line 404 of file VaRestRequestJSON.h.

◆ CustomVerb

FString UVaRestRequestJSON::CustomVerb
protected

Custom verb that will be used with RequestContentType == CUSTOM

Definition at line 447 of file VaRestRequestJSON.h.

◆ DeprecatedResponseString

FString UVaRestRequestJSON::DeprecatedResponseString
staticprotected

Default value for deprecated ResponseContent variable

Definition at line 400 of file VaRestRequestJSON.h.

◆ HttpRequest

TSharedRef<IHttpRequest, ESPMode::ThreadSafe> UVaRestRequestJSON::HttpRequest = FHttpModule::Get().CreateRequest()
protected

Request we're currently processing

Definition at line 450 of file VaRestRequestJSON.h.

◆ OnRequestComplete

FOnRequestComplete UVaRestRequestJSON::OnRequestComplete
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "VaRest|Event")

Event occured when the request has been completed

Definition at line 311 of file VaRestRequestJSON.h.

◆ OnRequestFail

FOnRequestFail UVaRestRequestJSON::OnRequestFail
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "VaRest|Event")

Event occured when the request wasn't successfull

Definition at line 318 of file VaRestRequestJSON.h.

◆ OnStaticRequestComplete

FOnStaticRequestComplete UVaRestRequestJSON::OnStaticRequestComplete

Event occured when the request has been completed

Definition at line 321 of file VaRestRequestJSON.h.

◆ OnStaticRequestFail

FOnStaticRequestFail UVaRestRequestJSON::OnStaticRequestFail

Event occured when the request wasn't successfull

Definition at line 324 of file VaRestRequestJSON.h.

◆ RequestBytes

TArray<uint8> UVaRestRequestJSON::RequestBytes
protected

Definition at line 412 of file VaRestRequestJSON.h.

◆ RequestContentType

EVaRestRequestContentType UVaRestRequestJSON::RequestContentType
protected

Content type to be applied for request

Definition at line 435 of file VaRestRequestJSON.h.

◆ RequestHeaders

TMap<FString, FString> UVaRestRequestJSON::RequestHeaders
protected

Mapping of header section to values. Used to generate final header string for request

Definition at line 438 of file VaRestRequestJSON.h.

◆ RequestJsonObj

UVaRestJsonObject* UVaRestRequestJSON::RequestJsonObj
protected

UPROPERTY()

Internal request data stored as JSON

Definition at line 410 of file VaRestRequestJSON.h.

◆ RequestVerb

EVaRestRequestVerb UVaRestRequestJSON::RequestVerb
protected

Verb for making request (GET,POST,etc)

Definition at line 432 of file VaRestRequestJSON.h.

◆ ResponseCode

int32 UVaRestRequestJSON::ResponseCode
protected

Http Response code

Definition at line 444 of file VaRestRequestJSON.h.

◆ ResponseContent

FString UVaRestRequestJSON::ResponseContent
BlueprintReadOnlyVisibleAnywhere

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")

DEPRECATED: Please use GetResponseContentAsString() instead

Definition at line 388 of file VaRestRequestJSON.h.

◆ ResponseHeaders

TMap<FString, FString> UVaRestRequestJSON::ResponseHeaders
protected

Cached key/value header pairs. Parsed once request completes

Definition at line 441 of file VaRestRequestJSON.h.

◆ ResponseJsonObj

UVaRestJsonObject* UVaRestRequestJSON::ResponseJsonObj
protected

UPROPERTY()

Response data stored as JSON

Definition at line 423 of file VaRestRequestJSON.h.

◆ ResponseJsonValue

UVaRestJsonValue* UVaRestRequestJSON::ResponseJsonValue
protected

UPROPERTY()

Response data stored as JSON value

Definition at line 429 of file VaRestRequestJSON.h.

◆ ResponseSize

int32 UVaRestRequestJSON::ResponseSize
BlueprintReadOnlyVisibleAnywhere

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")

Response size

Definition at line 380 of file VaRestRequestJSON.h.

◆ StringRequestContent

FString UVaRestRequestJSON::StringRequestContent
protected

Used for special cases when used wants to have plain string data in request. Attn.! Content-type x-www-form-urlencoded only.

Definition at line 417 of file VaRestRequestJSON.h.

◆ Tags

TArray<FName> UVaRestRequestJSON::Tags
protected

Array of tags that can be used for grouping and categorizing

Definition at line 357 of file VaRestRequestJSON.h.


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