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。