0
我想用mongoose C库开发一个服务器应用程序。在我尝试的初始阶段,我坚持发送HTTP请求的响应。我想送status 200
一个简单的响应使用的代码下面一行:mongoose mg_send_response_line()不工作
mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
printf("Response sent...\n");
但反应未接收到客户端(邮差或web浏览器)。 没有错误,甚至是printf line of Response sent is printed
。 作为针对这一点,以下行得到成功执行:
mg_http_send_error(nc,404, "Fatal Error!"); // I get this error at client side.
基本simplest_web_server也能正常工作。为什么我的单行代码发送响应失败。我无法理解/调试它。
Regards,
Neeraj。