# How to make a HTTP server?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-http-server/420995>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, unreal-engine, http, CPP, question\
**Created:** [March 27, 2018, 7:01am UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995 "2018-03-27T07:01:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![langlangking](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@langlangking](https://forums.unrealengine.com/u/langlangking)\
**Post date:** [March 27, 2018, 7:01am UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/1 "2018-03-27T07:01:17Z")

</div>

I do know how to make HTTP request after learning from tutorials.  
I wonder how to write a http server that any classes can make use of it.  
For example, in my class A, I need to get a jsonobject, I want the member function of the class “Http server” to return the json object. But how?  
The most confusing point is about  
Request-\>OnProcessRequestComplete().BindRaw(this, &HttpServer::OnResponseReceived);  
In OnResponseRecieved（）I’m sure that the http request is completed, but in other function I know nothing. I can return nothing in OnResponseRecieved（）.  
Maybe I can use TFunction to make my own callback fucntion in Class A, but it’s too complicated for me.  
Please give me some information, Thank you.

---

<div class="post-metadata">

**Author:** ![toni.alatalo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@toni.alatalo](https://forums.unrealengine.com/u/toni.alatalo)\
**Post date:** [March 27, 2018, 9:10am UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/2 "2018-03-27T09:10:58Z")

</div>

The question title is confusing because ‘HTTP server’ usually means a, well, http server … one that replies to requests. Whereas you want a http request maker, so client use and not server. You could call it a http request manager or something instead.

---

<div class="post-metadata">

**Author:** ![langlangking](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@langlangking](https://forums.unrealengine.com/u/langlangking)\
**Post date:** [April 13, 2018, 3:16am UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/3 "2018-04-13T03:16:29Z")

</div>

Thank you, I know little about networking.

---

<div class="post-metadata">

**Author:** ![langlangking](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@langlangking](https://forums.unrealengine.com/u/langlangking)\
**Post date:** [April 13, 2018, 3:17am UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/4 "2018-04-13T03:17:36Z")

</div>

Sorry for my confusing title. If someone has same problem, well now I am using Unreal Delegates.

---

<div class="post-metadata">

**Author:** ![egoldv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@egoldv](https://forums.unrealengine.com/u/egoldv)\
**Post date:** [April 20, 2018, 9:18pm UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/5 "2018-04-20T21:18:40Z")

</div>

You could look into several libraries:

1. [Overview | POCO C++ Libraries](https://pocoproject.org/)
2. [Boost.Asio - 1.55.0](https://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio.html)

Take some information from this thread [Small http server c++ - C++ Forum](http://www.cplusplus.com/forum/unices/127682/) or from AnswerShark site, where you can find many [homework answers](https://answershark.com/). Of course, it’s important to determine for what functions the server will be used.

---

<div class="post-metadata">

**Author:** ![DragonROSE](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dragonrose/32/491333_2.png) [@DragonROSE](https://forums.unrealengine.com/u/DragonROSE)\
**Post date:** [June 6, 2022, 7:50pm UTC](https://forums.unrealengine.com/t/how-to-make-a-http-server/420995/6 "2022-06-06T19:50:52Z")

</div>

I created a simple HttpServer with embedded UE C++ classes.  
[https://gitlab.com/DragonROSE/httpserverexample](https://gitlab.com/DragonROSE/httpserverexample)
