Hi,
I’m trying to make an HTTP request in C++, but i don’t know why i’m getting the same error.
OnProcessRequestCompleted’: not a member of ‘IHttpRequest’
here is my code:
.cpp
FHttpRequestRef HTTPReq = FHttpModule::Get().CreateRequest();|
HTTPReq->SetURL(http://localhost:3000/get-items);|
HTTPReq->SetVerb(GET);|
HTTPReq->OnProcessRequestCompleted().BindUObject(this, &UBPF_HTTPRequest::Response);|
HTTPReq->ProcessRequest();
void UBPF_HTTPRequest::Response(FHttpRequestPtr ReqOutput, FHttpResponsePtr Response, bool bIsConnected)
{
if (Response.IsValid())
{
UE_LOG(LogTemp, Display, TEXT("Response: %s"), *Response->GetContentAsString());
}
else
{
UE_LOG(LogTemp, Error, TEXT("HTTP Request failed!"));
}
}
.h
{
GENERATED_BODY()
private:
UFUNCTION(BlueprintCallable)
void AliveTest(FString IPClient);
private:
void Response(FHttpRequestPtr ReqOutput, FHttpResponsePtr Response, bool bIsConnected);
};
does anyone know why? Thanks
P.S: I have also tryed differend binding like BindRaw or BindLambda but nothing.