In this video, we go over how to make HTTP requests in Unreal Engine using the HTTP module and without relying on an external plugin or third-party library. We also covered how to include data in the body of HTTP requests as well as parse the data in the body of HTTP responses using the JSON module. In this barebones approach, C++ code was written to test out a dummy REST API for the purposes of this video, but blueprint code can be used to achieve the same result.
*****IMPORTANT LINKS*****
Code that was written in this video:
HttpTest.Build.cs: https://gist.github.com/chris-gong/e538bdbfe3b0f8b57fa909611013cf16
HttpTestGameMode.h: https://gist.github.com/chris-gong/b8f80c887324ea08eb1d7dd484985fa6
HttpTestGameMode.cpp: https://gist.github.com/chris-gong/8b9cd9156ec5ed54c8bd4983722745c8
Dummy API used in this video:
https://jsonplaceholder.typicode.com/
https://jsonplaceholder.typicode.com/posts/1
https://jsonplaceholder.typicode.com/posts/
Various documentation references with regards to the HTTP and JSON modules, specifically the functions, delegates, and variables we used in this video:
https://docs.unrealengine.com/en-US/API/Runtime/HTTP/
https://docs.unrealengine.com/en-US/API/Runtime/HTTP/FHttpRequestAdapterBase/
https://docs.unrealengine.com/en-US/API/Runtime/HTTP/Interfaces/IHttpRequest/
https://docs.unrealengine.com/en-US/API/Runtime/HTTP/Interfaces/IHttpResponse/
https://docs.unrealengine.com/en-US/API/Runtime/HTTP/GenericPlatform/FHttpRequestImpl/
https://docs.unrealengine.com/en-US/API/Runtime/Json/
https://docs.unrealengine.com/en-US/API/Runtime/Json/Dom/FJsonObject/
How to expose C++ code to blueprints: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/TechnicalGuide/ExtendingBlueprints/
How to support the channel:
Get a shirt or sweatshirt with free shipping (Use code "SHIP" at checkout): https://teespring.com/stores/flopperam
Become a member: https://www.youtube.com/channel/UCO77KLKwplncMHLo6gLpIHw/join
Support us on Patreon: https://www.patreon.com/flopperam
Donate to our PayPal: https://www.paypal.me/flopperam
Sponsor us on Github: https://github.com/sponsors/chris-gong
Social media links:
Discord: https://discord.gg/8yvTRBv
Twitter: https://twitter.com/Flopperam
Instagram: https://www.instagram.com/flopperam/
Facebook: https://www.facebook.com/flopperam
0:00 Intro
0:32 Example GET Request
5:18 JSON parsing
7:42 Example POST Request
10:25 Outro
#ue5 #http #rest