Can't bind FHttpRequestProgressDelegate

Hi,

I’m having trouble binding FHttpRequestProgressDelegate. My code simply won’t compile, and the error message simply says there’s a linking error.

The code in question is below:

// connects to the server
void ALevelController::connect(FString serverLoc, int32 port)
{

// creates the request to be sent
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetVerb("GET");
Request->SetURL(FString("http://localhost:8080/join_server/1"));
Request->OnRequestProgress().BindUFunction(this, &ALevelController::handleData);
Request->ProcessRequest();
FHttpRequestProgressDelegate

}

// handles data being receieved
void handleData(FHttpRequestPtr request, int32 data)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT(“Got data”));
}

It will compile with no problem if you remove this line:
Request->OnRequestProgress().BindUFunction(this, &ALevelController::handleData);

But I have no idea as to what the problem is.

Could anyone help?

Thanks in advance,
David

I useed this code below:

  1. bind
    Request->OnRequestProgress().BindUObject(this, &AHttpUtils::OnProgressRequest);

void SomeClass::OnProgressRequest(FHttpRequestPtr Request, int32 data1, int32 data2)
{

}