diff --git a/Source/GameSwiftSdk/Private/RequestHandler.cpp b/Source/GameSwiftSdk/Private/RequestHandler.cpp index aaa06c2..efc4886 100644 --- a/Source/GameSwiftSdk/Private/RequestHandler.cpp +++ b/Source/GameSwiftSdk/Private/RequestHandler.cpp @@ -5,12 +5,18 @@ #if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 24 -TSharedRef FRequestHandler::SendRequest( + using HttpRequestRef = TSharedRef; #else -TSharedRef FRequestHandler::SendRequest( + using HttpRequestRef = TSharedRef; #endif - FString FullUrl, FString Method, const FString callBody, const FString accessToken, bool ExpectsWwwResponse) -{ + +HttpRequestRef FRequestHandler::SendRequest( + FString FullUrl, + FString Method, + const FString& callBody, + const FString& accessToken, + bool ExpectsWwwResponse +) { auto HttpRequest = FHttpModule::Get().CreateRequest(); HttpRequest->SetVerb(Method); HttpRequest->SetURL(FullUrl); diff --git a/Source/GameSwiftSdk/Public/RequestHandler.h b/Source/GameSwiftSdk/Public/RequestHandler.h index 5ef2dfd..eb28073 100644 --- a/Source/GameSwiftSdk/Public/RequestHandler.h +++ b/Source/GameSwiftSdk/Public/RequestHandler.h @@ -11,12 +11,17 @@ class FRequestHandler { public: #if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 24 - static TSharedRef SendRequest( + using HttpRequestRefType = TSharedRef; #else - static TSharedRef SendRequest( + using HttpRequestRefType = TSharedRef; #endif - FString FullUrl, FString Method, const FString callBody, const FString accessToken, - bool ExpectsWwwResponse = false); + static HttpRequestRefType SendRequest( + const FString& FullUrl, + const FString& Method, + const FString& callBody, + const FString& accessToken, + bool ExpectsWwwResponse = false + ); static bool DecodeRequest(FHttpResponsePtr HttpResponse, bool bSucceeded, FJsonObject& ResultObject, FBaseSdkFailResponse& OutError);