HTTP API – Web request

When you're maintaining scoreboards or other such things that require regular HTTP request access to servers, you can use the HTTP API to perform such web request tasks.

Getting ready

Have a server to which you're allowed to request data via HTTP. You can use a public server of any type to try out HTTP requests if you'd like.

How to do it…

  1. Link to the HTTP API in your ProjectName.Build.cs file.
  2. In the file in which you will send your web request, include the HttpModule.h header file, the HttpManager.h header file, and the HttpRetrySystem.h file, as shown in the following code snippet:
    #include "Runtime/Online/HTTP/Public/HttpManager.h" #include "Runtime/Online/HTTP/Public/HttpModule.h" #include "Runtime/Online/HTTP/Public/HttpRetrySystem.h" ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.