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.
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.
Link to the HTTP API in your
ProjectName.Build.cs
file.In the file in which you will send your web request, include the
HttpModule.h
header file, theHttpManager.h
header file, and theHttpRetrySystem.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"
Construct an
IHttpRequest
object fromFHttpModule
using the following code:TSharedRef<IHttpRequest> http=FHttpModule::Get().CreateRequest();