// Copyright 2024, CodeSpartan

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "HttpHeader.h"
#include "JsonObjectWrapper.h"
#include "HttpRequestCpp.generated.h"

DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnHttpRequestResponse, bool, Success, const FString&, Body);

UCLASS(Blueprintable, BlueprintType)
class MMOKITCODE_API UHttpRequestCpp : public UObject
{
	GENERATED_BODY()

public:

	// This delegate is assigned during NewObject by UHttpSubsystemCpp
	UPROPERTY()
	FOnHttpRequestResponse OnResponseDelegate;

	// Called by BP when Http request returns
	UFUNCTION(BlueprintCallable, Category = "HTTP Request")
	void CallOnResponseDelegate(bool Success, const FString& Body);
};
