MetaSoul

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
UESRequestJSON Class Reference

`#include <ESRequestJSON.h>`

Inheritance diagram for UESRequestJSON:

## Public Member Functions
| UFUNCTION (BlueprintCallable, meta=(DisplayName="Construct Json Request (Empty)", HidePin="WorldContextObject", DefaultToSelf="WorldContextObject"), Category="EmoShapeJson|Request") static UESRequestJSON *ConstructRequest(UObject *WorldContextObject)
void | SetVerb (EEmoShapeIORequestVerb Verb)
void | SetCustomVerb (FString Verb)
void | SetContentType (EEmoShapeIORequestContentType ContentType)
void | SetBinaryContentType (const FString &ContentType)
void | SetBinaryRequestContent (const TArray< uint8 > &Content)
void | SetHeader (const FString &HeaderName, const FString &HeaderValue)
void | ResetData ()
void | ResetRequestData ()
void | ResetResponseData ()
void | Cancel ()
UESJsonObject * | GetRequestObject ()
void | SetRequestObject (UESJsonObject *JsonObject)
UESJsonObject * | GetResponseObject ()
void | SetResponseObject (UESJsonObject *JsonObject)
FString | GetURL ()
EEmoShapeIORequestStatus | GetStatus ()
int32 | GetResponseCode ()
FString | GetResponseHeader (const FString HeaderName)
TArray< FString > | GetAllResponseHeaders ()
virtual void | ProcessURL (const FString &Url=TEXT("http://alyamkin.com"))
virtual void | ApplyURL (const FString &Url, UESJsonObject *&Result, UObject *WorldContextObject, struct FLatentActionInfo LatentInfo)
void | ProcessRequest ()
void | AddTag (FName Tag)
int32 | RemoveTag (FName Tag)
bool | HasTag (FName Tag) const

## Static Public Member Functions
static UESRequestJSON * | ConstructRequestExt (UObject *WorldContextObject, EEmoShapeIORequestVerb Verb, EEmoShapeIORequestContentType ContentType)

## Public Attributes
FOnRequestComplete | OnRequestComplete
FOnRequestFail | OnRequestFail
FOnStaticRequestComplete | OnStaticRequestComplete
FOnStaticRequestFail | OnStaticRequestFail
FString | ResponseContent
bool | bIsValidJsonResponse
bool | bShouldHaveBinaryResponse
TFunction< void(TArray< uint8 > &) | OnProcessURLCompleteCallback )
TArray< uint8 > | ResultBinaryData

## Protected Attributes
TArray< FName > | Tags
FEmoShapeJsonLatentAction< UESJsonObject * > * | ContinueAction
UESJsonObject * | RequestJsonObj
TArray< uint8 > | RequestBytes
FString | BinaryContentType
UESJsonObject * | ResponseJsonObj
EEmoShapeIORequestVerb | RequestVerb
EEmoShapeIORequestContentType | RequestContentType
TMap< FString, FString > | RequestHeaders
TMap< FString, FString > | ResponseHeaders
int32 | ResponseCode
FString | CustomVerb
FHttpRequestRef | HttpRequest = FHttpModule::Get().CreateRequest()

## Member Function Documentation

## ◆ AddTag()

void UESRequestJSON::AddTag | ( | FName | Tag | ) |

Add tag to this request

## ◆ ApplyURL()

void UESRequestJSON::ApplyURL | ( | const FString & | Url,
|  | UESJsonObject *& | Result,
|  | UObject * | WorldContextObject,
|  | struct FLatentActionInfo | LatentInfo )
| virtual

Open URL in latent mode

## ◆ Cancel()

void UESRequestJSON::Cancel | ( |  | ) |

Cancel latent response waiting

## ◆ ConstructRequestExt()

UESRequestJSON * UESRequestJSON::ConstructRequestExt | ( | UObject * | WorldContextObject,
|  | EEmoShapeIORequestVerb | Verb,
|  | EEmoShapeIORequestContentType | ContentType )
| static

Creates new request with defined verb and content type

## ◆ GetAllResponseHeaders()

TArray< FString > UESRequestJSON::GetAllResponseHeaders | ( |  | ) |

Get list of all response headers

## ◆ GetRequestObject()

UESJsonObject * UESRequestJSON::GetRequestObject | ( |  | ) |

Get the Request Json object

## ◆ GetResponseCode()

int32 UESRequestJSON::GetResponseCode | ( |  | ) |

Get the response code of the last query

## ◆ GetResponseHeader()

FString UESRequestJSON::GetResponseHeader | ( | const FString | HeaderName | ) |

Get value of desired response header

## ◆ GetResponseObject()

UESJsonObject * UESRequestJSON::GetResponseObject | ( |  | ) |

Get the Response Json object

## ◆ GetStatus()

EEmoShapeIORequestStatus UESRequestJSON::GetStatus | ( |  | ) |

Get status of http request

## ◆ GetURL()

FString UESRequestJSON::GetURL | ( |  | ) |

Get url of http request

## ◆ HasTag()

bool UESRequestJSON::HasTag | ( | FName | Tag | ) | const

See if this request contains the supplied tag

## ◆ ProcessRequest()

void UESRequestJSON::ProcessRequest | ( |  | ) |

Apply current internal setup to request and process it

## ◆ ProcessURL()

void UESRequestJSON::ProcessURL | ( | const FString & | Url = TEXT("http://alyamkin.com") | ) |
| virtual

Open URL with current setup

## ◆ RemoveTag()

int32 UESRequestJSON::RemoveTag | ( | FName | Tag | ) |

Remove tag from this request

Returns
  Number of removed elements

## ◆ ResetData()

void UESRequestJSON::ResetData | ( |  | ) |

Reset all internal saved data

## ◆ ResetRequestData()

void UESRequestJSON::ResetRequestData | ( |  | ) |

Reset saved request data

## ◆ ResetResponseData()

void UESRequestJSON::ResetResponseData | ( |  | ) |

Reset saved response data

## ◆ SetBinaryContentType()

void UESRequestJSON::SetBinaryContentType | ( | const FString & | ContentType | ) |

Set content type of the request for binary post data

## ◆ SetBinaryRequestContent()

void UESRequestJSON::SetBinaryRequestContent | ( | const TArray< uint8 > & | Content | ) |

Set content of the request for binary post data

## ◆ SetContentType()

void UESRequestJSON::SetContentType | ( | EEmoShapeIORequestContentType | ContentType | ) |

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

## ◆ SetCustomVerb()

void UESRequestJSON::SetCustomVerb | ( | FString | Verb | ) |

Set custom verb to the request

## ◆ SetHeader()

void UESRequestJSON::SetHeader | ( | const FString & | HeaderName,
|  | const FString & | HeaderValue )

Sets optional header info

## ◆ SetRequestObject()

void UESRequestJSON::SetRequestObject | ( | UESJsonObject * | JsonObject | ) |

Set the Request Json object

## ◆ SetResponseObject()

void UESRequestJSON::SetResponseObject | ( | UESJsonObject * | JsonObject | ) |

Set the Response Json object

## ◆ SetVerb()

void UESRequestJSON::SetVerb | ( | EEmoShapeIORequestVerb | Verb | ) |

Set verb to the request

## ◆ UFUNCTION()

UESRequestJSON::UFUNCTION | ( | BlueprintCallable | ,
|  | meta | = (DisplayName="Construct Json Request (Empty)", HidePin="WorldContextObject", DefaultToSelf="WorldContextObject"),
|  | Category | = "EmoShapeJson|Request" )

Creates new request (totally empty)

## Member Data Documentation

## ◆ BinaryContentType

FString UESRequestJSON::BinaryContentType
| protected

## ◆ bIsValidJsonResponse

bool UESRequestJSON::bIsValidJsonResponse

Is the response valid JSON?

## ◆ bShouldHaveBinaryResponse

bool UESRequestJSON::bShouldHaveBinaryResponse

If this is true it will call back on the binary callback instead of json

## ◆ ContinueAction

FEmoShapeJsonLatentAction<UESJsonObject*>* UESRequestJSON::ContinueAction
| protected

Latent action helper

## ◆ CustomVerb

FString UESRequestJSON::CustomVerb
| protected

Custom verb that will be used with RequestContentType == CUSTOM

## ◆ HttpRequest

FHttpRequestRef UESRequestJSON::HttpRequest = FHttpModule::Get().CreateRequest()
| protected

Request we're currently processing

## ◆ OnProcessURLCompleteCallback

TFunction<void(TArray<uint8>&) UESRequestJSON::OnProcessURLCompleteCallback)

## ◆ OnRequestComplete

FOnRequestComplete UESRequestJSON::OnRequestComplete

Event occured when the request has been completed

## ◆ OnRequestFail

FOnRequestFail UESRequestJSON::OnRequestFail

Event occured when the request wasn't successfull

## ◆ OnStaticRequestComplete

FOnStaticRequestComplete UESRequestJSON::OnStaticRequestComplete

Event occured when the request has been completed

## ◆ OnStaticRequestFail

FOnStaticRequestFail UESRequestJSON::OnStaticRequestFail

Event occured when the request wasn't successfull

## ◆ RequestBytes

TArray<uint8> UESRequestJSON::RequestBytes
| protected

## ◆ RequestContentType

EEmoShapeIORequestContentType UESRequestJSON::RequestContentType
| protected

Content type to be applied for request

## ◆ RequestHeaders

TMap<FString, FString> UESRequestJSON::RequestHeaders
| protected

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

## ◆ RequestJsonObj

UESJsonObject* UESRequestJSON::RequestJsonObj
| protected

Internal request data stored as JSON

## ◆ RequestVerb

EEmoShapeIORequestVerb UESRequestJSON::RequestVerb
| protected

Verb for making request (GET,POST,etc)

## ◆ ResponseCode

int32 UESRequestJSON::ResponseCode
| protected

Http Response code

## ◆ ResponseContent

FString UESRequestJSON::ResponseContent

Request response stored as a string

## ◆ ResponseHeaders

TMap<FString, FString> UESRequestJSON::ResponseHeaders
| protected

Cached key/value header pairs. Parsed once request completes

## ◆ ResponseJsonObj

UESJsonObject* UESRequestJSON::ResponseJsonObj
| protected

Response data stored as JSON

## ◆ ResultBinaryData

TArray<uint8> UESRequestJSON::ResultBinaryData

## ◆ Tags

TArray<FName> UESRequestJSON::Tags
| protected

Array of tags that can be used for grouping and categorizing

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

- EmoShapeJson/Public/ESRequestJSON.h
- Public/ESRequestJSON.cpp