Internet Protocol
Unreal Engine Plugin

HTTP Client

How to use HTTP client class

References

#include "Http/HttpClient.h"

How to use

Blueprint: search by GetInternetProtocolSubsystem and call CreateHttpClient function

C++: Use the code bellow

#include "Http/HttpClient.h"
 
UHttpClient* HttpClient = NewObject<UHttpClient>();

Functions

Set Host

  • Set the adress and port of host Http client

Get Socket

  • Get socket properties Http client

Set Request

  • Set the HTTP request to be sent Http client

Get Request

  • Get the HTTP request to be sent Http client

Set Request Method

  • Set request verb Http client

Get Request Method

  • Get request verb Http client

Set Version

  • Set request version Http client

Get Version

  • Get request version Http client

Set Path

  • Set request version Http client

Get Path

  • Get request version Http client

Set Params

  • Http client

Get Params

  • Get a reference to parameters from request
  • Can be used to modify or append parameters Http client

Set Headers

  • Append headers to request Http client

Get Headers

  • Get a reference to headers from request Http client

Set Body

  • Set request body Http client

Clear Body

  • Clear request body Http client

Get Body

  • Get request body Http client

Get Request Data

  • Get request data Http client

Prepare Payload

  • Prepare request data
  • Must be called before call ProcessRequest function Http client

Async Prepare Payload

  • Prepare request data asynchronously
  • Must be called before call ProcessRequest function Http client

Get Payload Data

  • Get processed payload data Http client

Get Response Data

  • Get latest response data Http client

Process Request

  • Send request
  • Return false if socket is closed Http client

Close

  • Close connection
  • Also can be used to cancel a request Http client

Clear Request

  • Clear request data Http client

Clear Payload

  • Clear payload data Http client

Clear Response

  • Clear response buffer Http client

Get Error Code

  • Get latest error code Http client

Events

On Async Payload Finished

  • Event triggered when payload process has been finished Http client

On Request Progress

  • Event triggered when socket send and receive data Http client

On Request Completed

  • Event triggered when request is done Http client

On Request fail

  • Event triggered if request fail Http client

On Close

  • Event triggered when socket is closed Http client

On Error

  • Event triggered if any error occur during async process Http client