I'm searching a cgi lib in C to build a restful web service

江枫思渺然 提交于 2019-12-12 14:00:23

问题


I want to build a restful (CoAP) web service which can execute c code to handle events.

Therefore I'm searching a lib which provides me with a rest api in C and cgi similar to restcgi which is sadly in c++ or CGI-Simple which is in perl.

The server is running on a embedded device so it has very limited resources and the services will be accessed only by machines.

Thank you very much.


回答1:


You may be interested in Raphters framework and its architecture. It's pretty small, so you can examine the code, the framework itself can be used as a FastCGI backend for some web server, e.g. for nginx.




回答2:


I have recently came across one quite interesting CoAP library which uses libevent. You will aslo want to check Klone embeddable HTTP server by the same guys at KoanLogic. I have previously looked at libcoap, but it didn't find it very usable at the time. You may also wish to try using either libuv, libev or (libevent)[http://libevent.org]. But I guess it's probably gonna be much easier to adopt some of the code from WT repository and get your CoAP/HTTP server done.



来源:https://stackoverflow.com/questions/9597847/im-searching-a-cgi-lib-in-c-to-build-a-restful-web-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!