Skip to Content
Internet Protocol
Unreal Engine Plugin

HTTP Client

HTTP client for Unreal Engine: Blueprint nodes, events and C++ usage with the Internet Protocol plugin.

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* client = NewObject<UHttpClient>();

Variables

Idle Timeout Seconds

  • Set/Get timeout value in seconds
Idle Timeout Seconds
Variable

Use Tls

  • New in 4.0. Encrypts the connection with TLS. With no Set Tls Options call, the secure default options are used.
  • Applies to the next connection.
Use Tls
Variable

Max Redirects

  • New in 4.0. Follows up to this many redirects (301, 302, 303, 307, 308) on the same host. A 303, or a redirected POST, becomes a GET. Default 0: redirects are delivered as responses.
Max Redirects
Variable

Functions

Is Open

  • Return true if socket is open.
Is Open
Return Value
Pure function

Set Host

  • Set address and port to resolve. Must be called before use 'Request' function.
  • Since 4.0, setting another host cancels the in-flight and queued requests: their callbacks receive Operation cancelled.
Set HostTarget is Http Client
Target
Bind Opts
Function

Request

  • Process payload and send request.
  • Requests are queued and sent one at a time over a single keep-alive connection, which is opened automatically when needed. You can call Request several times in a row.
  • The callback fires exactly once per request: with the response, or with an Error Code if the connection fails, the response is malformed, the connection is closed or Close is called.
  • For HEAD requests the response never has a body, whatever its headers say.
  • Since 4.0:
    • It returns the request id, used by Cancel and On Progress.
    • Timeout Seconds in the request fails it with Operation timed out when the response does not arrive in time.
    • Binary bodies go in Body Bytes, and repeated headers (several Set-Cookie...) in Header List. See HTTP Request.
    • Interim 1xx responses (100, 103...) are skipped.
    • An idempotent request whose reused keep-alive connection closed before any response byte is sent again once, on a new connection.
RequestTarget is Http Client
Target
Request
Callback
Return Value
Function
On RequestCustom Event
Error Code
Response
Event

Close

  • Close the underlying socket and stop listening for data on it. Also can be used to force cancel the request process: every queued request receives its callback with an error.
CloseTarget is Http Client
Target
Function

Set Url

  • New in 4.0. Sets the host from a URL, http://host[:port]/... or https:// (TLS is chosen from the scheme). The path is not used: set Path in each request.
Set UrlTarget is Http Client
Target
Url
Return Value
Function

Cancel

  • New in 4.0. Cancels a queued or in-flight request: its callback receives the Operation cancelled error. Returns false if the id is unknown.
CancelTarget is Http Client
Target
Request Id
Return Value
Function

Set Tls Options

  • New in 4.0. Turns TLS on with these options. See Security Context Options.
  • The server certificate is verified with these options.
  • Applies to the next connection.
Set Tls OptionsTarget is Http Client
Target
Sec Opts
Function

Events

On Progress

  • New in 4.0. Download progress of the current request, about every 64 KiB: bytes received and the Content-Length (-1 if unknown).
Bind Event to On Progress
Target
Event
On ProgressCustom Event
Request Id
Bytes Received
Total Bytes
Event binding
Edit on GitHub

On this page