0
\$\begingroup\$

I'm trying to add HTTP requests to my game and everything compiles fine until I try to set up a delegate for when the response is ready. Adding this function causes the compiler to fail for syntax error identifier FHttpRequestPtr.

header

void OnSaveTokenResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);

cpp

void UGamejoltApi::OnSaveTokenResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{

}

I have both #include "Http.h" and #include "Interfaces/IHttpRequest.h". I also have this in my build file PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "HTTP" });.

\$\endgroup\$
  • \$\begingroup\$ Any help is greatly appreciated. I can't make the game without the ability to make some HTTP requests. \$\endgroup\$ – Jason Crosby Jan 5 at 15:35
1
\$\begingroup\$

The solution was to move the #import "Http.h" to the header file. Then it compiles fine.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.