Download

How can I make fetch requests

Hi I want to make fetch requests, I know how to do it with VaRest but in unreal engine 5 you cant install plugins so how can you make fetch calls?

The only way is C++ or to recompile varest for ue5 yourself.

Something like this

TSharedRef<IHttpRequest, ESPMode::ThreadSafe> UGoogleSheetsOperator::SendAuthorizedGenericRequest_Internal(
	const FString& InToken, const FParams OperationParams,
	const ERequestVerb InVerb, const FString& InURL,
	const bool bShouldProcessRequest, const FString& ContentType)
{
	FHttpModule* HTTP_Module = &FHttpModule::Get();
	TSharedRef<IHttpRequest, ESPMode::ThreadSafe> Request = HTTP_Module->CreateRequest();

	Request->SetURL(InURL);
	Request->SetVerb(GetRequestVerbAsString(InVerb));
	Request->SetHeader("Authorization", "Bearer " + InToken);
	Request->SetHeader("Content-Type", ContentType);
	Request->SetHeader("Accept", ContentType);
	Request->SetTimeout(OperationParams.RequestTimeout);
	AddToRoot();

	if (bShouldProcessRequest)
	{
		Request->ProcessRequest();
	}

	return Request;
}

Happy to help you understand the components of this function, but your best bet is just trying to recompile varest on ue5. It’s not too hard if you watch a tutorial. Failing that, you could contact the varest devs and ask if they have a ue5 ea version for you to pinch.