how to parse http request in c++

后端 未结 4 2063
梦如初夏
梦如初夏 2021-02-09 01:01

I\'m trying to write a small c++ webserver which handles GET, POST, HEAD requests. My problem is I don\'t know how to parse the headers, message body, etc. It\'s listening on th

4条回答
  •  佛祖请我去吃肉
    2021-02-09 01:42

    Yes, this is basically just string parsing and then the response creating that goes back to the browser, following the specification.

    But if this is not just an hobby project and you do not want to take on a really big task you should use either Apache, if you need a web server you need to extend, or tntnet, if you need a c++ web framework, or cpp-netlib if you need C++ network stuff.

提交回复
热议问题