| 1234567891011121314151617181920212223242526272829303132333435363738 |
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Actor.h"
- #include "Runtime/Online/HTTP/Public/Http.h"
- #include "HttpReqActor.generated.h"
- DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FResponseDelegate, FString, Response);
- UCLASS(ClassGroup = (HttpReq), meta = (BlueprintSpawnableComponent))
- class COMMUNICATION_ORG_API UHttpReqActor : public UActorComponent
- {
- GENERATED_BODY()
-
- public:
- // Sets default values for this actor's properties
- UHttpReqActor();
- protected:
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- UPROPERTY(BlueprintAssignable)
- FResponseDelegate OnPostResponseReceived;
- FHttpModule* Http;
- /* The actual HTTP call */
- //UFUNCTION(BlueprintPure, Category = "HttpReq")
- UFUNCTION(BlueprintCallable, Category = "HttpReq")
- bool Post(FString URL,FString ContentString);
- /*Assign this function to call when the GET request processes sucessfully*/
- void OnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
- };
|