New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added custom header support (such as Auth, User-agent, Connection) #381
base: develop
Are you sure you want to change the base?
Conversation
@@ -30,7 +30,7 @@ void UVaRestSubsystem::Deinitialize() | |||
Super::Deinitialize(); | |||
} | |||
|
|||
void UVaRestSubsystem::CallURL(const FString& URL, EVaRestRequestVerb Verb, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback) | |||
void UVaRestSubsystem::CallURL(const FString& URL, EVaRestRequestVerb Verb, TMap<FString, FString> headers, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a const reference since it's not being modified.
for (const TPair<FString, FString>& pair : headers) | ||
Request->SetHeader(pair.Key, pair.Value); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add {} to match the rest of the code?
@@ -15,10 +15,11 @@ DECLARE_DYNAMIC_DELEGATE_OneParam(FVaRestCallDelegate, UVaRestRequestJSON*, Requ | |||
USTRUCT() | |||
struct FVaRestCallResponse | |||
{ | |||
GENERATED_BODY() | |||
GENERATED_USTRUCT_BODY() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be GENERATED_BODY
as GENERATED_USTRUCT_BODY
is old and deprecated.
@@ -51,7 +52,7 @@ class VAREST_API UVaRestSubsystem : public UEngineSubsystem | |||
public: | |||
/** Easy way to process http requests */ | |||
UFUNCTION(BlueprintCallable, Category = "VaRest|Utility") | |||
void CallURL(const FString& URL, EVaRestRequestVerb Verb, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback); | |||
void CallURL(const FString& URL, EVaRestRequestVerb Verb, TMap<FString, FString> headers, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ref
Thanks you for your comment. |
just updated |
@@ -30,7 +30,7 @@ void UVaRestSubsystem::Deinitialize() | |||
Super::Deinitialize(); | |||
} | |||
|
|||
void UVaRestSubsystem::CallURL(const FString& URL, EVaRestRequestVerb Verb, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback) | |||
void UVaRestSubsystem::CallURL(const FString& URL, EVaRestRequestVerb Verb, const TMap<FString, FString> headers, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the headers tmap a const ref?
@@ -51,7 +52,7 @@ class VAREST_API UVaRestSubsystem : public UEngineSubsystem | |||
public: | |||
/** Easy way to process http requests */ | |||
UFUNCTION(BlueprintCallable, Category = "VaRest|Utility") | |||
void CallURL(const FString& URL, EVaRestRequestVerb Verb, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback); | |||
void CallURL(const FString& URL, EVaRestRequestVerb Verb, const TMap<FString, FString> headers, EVaRestRequestContentType ContentType, UVaRestJsonObject* VaRestJson, const FVaRestCallDelegate& Callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmap as const ref
Sorry for the const ref 😅 (updated) |
what is TeamCity ? |
No description provided.