Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Finish v1.1-r13
Browse files Browse the repository at this point in the history
  • Loading branch information
ufna committed May 3, 2016
2 parents 9bd29c8 + d63ac04 commit eae2dc3
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 244 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ Key features:
* Blueprintable FJsonObject wrapper with almost full support of Json features: different types of values, **arrays**, **binary data** content, both ways serializarion to FString, etc.
* Blueprintable FJsonValue wrapper - **full Json features made for blueprints!**
* Both bindable events and **latent functions** are provided to control the asynchronous requests
* [Parse](https://parse.com) REST API manager to start working with Parse out of the box!

Check the [Wiki](https://github.com/ufna/VaRest/wiki) tab for plugin usage examples and installation notes.

Current version: **1.1 R 12** (UE 4.8-4.10)
Current version: **1.1 R 13** (UE 4.11)

![SCREENSHOT](SCREENSHOT.jpg)

Expand Down
2 changes: 2 additions & 0 deletions Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,5 @@ FText UVaRest_BreakJson::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return LOCTEXT("VaRest_Break_Json.NodeTitle", "Break Json");
}

#undef LOCTEXT_NAMESPACE
12 changes: 11 additions & 1 deletion Source/VaRestPlugin/Classes/Json/VaRestRequestJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ namespace ERequestVerb
GET,
POST,
PUT,
DEL UMETA(DisplayName="DELETE")
DEL UMETA(DisplayName="DELETE"),
/** Set CUSTOM verb by SetCustomVerb() function */
CUSTOM
};
}

Expand Down Expand Up @@ -114,6 +116,10 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject
UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
void SetVerb(ERequestVerb::Type Verb);

/** Set custom verb to the request */
UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
void SetCustomVerb(FString Verb);

/** 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 */
UFUNCTION(BlueprintCallable, Category = "VaRest|Request")
Expand Down Expand Up @@ -268,4 +274,8 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject

/** Http Response code */
int32 ResponseCode;

/** Custom verb that will be used with RequestContentType == CUSTOM */
FString CustomVerb;

};
77 changes: 0 additions & 77 deletions Source/VaRestPlugin/Classes/Parse/VaRestParseManager.h

This file was deleted.

25 changes: 17 additions & 8 deletions Source/VaRestPlugin/Private/Json/VaRestRequestJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ void UVaRestRequestJSON::SetVerb(ERequestVerb::Type Verb)
RequestVerb = Verb;
}

void UVaRestRequestJSON::SetCustomVerb(FString Verb)
{
CustomVerb = Verb;
}

void UVaRestRequestJSON::SetContentType(ERequestContentType::Type ContentType)
{
RequestContentType = ContentType;
Expand Down Expand Up @@ -239,19 +244,23 @@ void UVaRestRequestJSON::ProcessRequest(TSharedRef<IHttpRequest> HttpRequest)
switch (RequestVerb)
{
case ERequestVerb::GET:
HttpRequest->SetVerb("GET");
HttpRequest->SetVerb(TEXT("GET"));
break;

case ERequestVerb::POST:
HttpRequest->SetVerb("POST");
HttpRequest->SetVerb(TEXT("POST"));
break;

case ERequestVerb::PUT:
HttpRequest->SetVerb("PUT");
HttpRequest->SetVerb(TEXT("PUT"));
break;

case ERequestVerb::DEL:
HttpRequest->SetVerb("DELETE");
HttpRequest->SetVerb(TEXT("DELETE"));
break;

case ERequestVerb::CUSTOM:
HttpRequest->SetVerb(CustomVerb);
break;

default:
Expand All @@ -263,7 +272,7 @@ void UVaRestRequestJSON::ProcessRequest(TSharedRef<IHttpRequest> HttpRequest)
{
case ERequestContentType::x_www_form_urlencoded_url:
{
HttpRequest->SetHeader("Content-Type", "application/x-www-form-urlencoded");
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded"));

FString UrlParams = "";
uint16 ParamIdx = 0;
Expand All @@ -290,7 +299,7 @@ void UVaRestRequestJSON::ProcessRequest(TSharedRef<IHttpRequest> HttpRequest)
}
case ERequestContentType::x_www_form_urlencoded_body:
{
HttpRequest->SetHeader("Content-Type", "application/x-www-form-urlencoded");
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded"));

FString UrlParams = "";
uint16 ParamIdx = 0;
Expand All @@ -317,14 +326,14 @@ void UVaRestRequestJSON::ProcessRequest(TSharedRef<IHttpRequest> HttpRequest)
}
case ERequestContentType::binary:
{
HttpRequest->SetHeader("Content-Type", BinaryContentType);
HttpRequest->SetHeader(TEXT("Content-Type"), BinaryContentType);
HttpRequest->SetContent(RequestBytes);

break;
}
case ERequestContentType::json:
{
HttpRequest->SetHeader("Content-Type", "application/json");
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json"));

// Serialize data to json string
FString OutputString;
Expand Down
138 changes: 0 additions & 138 deletions Source/VaRestPlugin/Private/Parse/VaRestParseManager.cpp

This file was deleted.

1 change: 0 additions & 1 deletion Source/VaRestPlugin/Private/VaRestPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class FVaRestPlugin : public IVaRestPlugin
UVaRestJsonObject::StaticClass();
UVaRestJsonValue::StaticClass();
UVaRestRequestJSON::StaticClass();
UVaRestParseManager::StaticClass();
}

virtual void ShutdownModule() override
Expand Down
10 changes: 0 additions & 10 deletions Source/VaRestPlugin/VaRestPlugin.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ namespace UnrealBuildTool.Rules
{
public class VaRestPlugin : ModuleRules
{
private string ModulePath
{
get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
}

private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}

public VaRestPlugin(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
Expand Down
15 changes: 8 additions & 7 deletions VaRestPlugin.uplugin
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"FileVersion" : 3,
"FileVersion" : 3,

"FriendlyName" : "VaRest",
"Version" : 12,
"VersionName" : "1.1-r12",
"Version" : 13,
"VersionName" : "1.1-r13",
"CreatedBy" : "Vladimir Alyamkin",
"CreatedByURL" : "http://alyamkin.com",
"EngineVersion" : 1579795,
"Description" : "Plugin that makes REST (JSON) server communication easy to use. Parse API helpers included.",
"EngineVersion" : "4.11.0",
"Description" : "Plugin that makes REST (JSON) server communication easy to use",
"Category" : "Network",
"MarketplaceURL" : "com.epicgames.launcher://ue/marketplace/offers/e47be161e7a24e928560290abd5dcc4f",

"Modules" :
"Modules" :
[
{
"Name" : "VaRestPlugin",
"Type" : "Runtime",
"LoadingPhase": "PreDefault"
"LoadingPhase": "PreDefault"
},
{
"Name": "VaRestEditorPlugin",
Expand Down

0 comments on commit eae2dc3

Please sign in to comment.