i don't konw why all of the answers here make a very simple work very hard!
when there is a request on HTTP, actually a client will send a HTTP_MESSAGE to server (read about what is a HTTP_MESSAGE) and you can make a server in just 2 simple step:
1. install netcat:
in many unix-based systems you have this already installed and if you have windows just google it , the installation process is really simple, you just need a nc.exe file and then you should copy the path of this nc.exe file to your path environmet variable and check if every think is ok with nc -h
2. make a server which is listening on localhost:12345:
just type nc -l -p 12345
on your terminal and everything is done! (in mac nc -l 12345
tnx Silvio Biasiol)
now you have a server which is listening on http://localhost:12345
make a post request with axios.post('http://localhost:12345', { firstName: 'Fred' })
if you are a js develper or make your own xhr
or make a form in a html file and submit it to server, sth like <form action="http://localhost:12345" method="post">
or make a request with curl
or wget
or etc. and then check your terminal, a raw HTTP_MESSAGE should be appear on your terminal and you can start your happy hacking ;)