[Libwebsockets] Send http response after parsing request body

Kun Zhao kzhdev at gmail.com
Wed Mar 13 21:28:22 CET 2019


Hi Andy,

I need to response a POST after parsing the request body. Can I call
lws_add_http_common_headers and lws_finalize_write_http_header in
LWS_CALLBACK_HTTP_BODY_COMPLETION? In this case, should I call
lws_callback_on_writable(wsi) in LWS_CALLBACK_HTTP or in
LWS_CALLBACK_HTTP_BODY_COMPLETION? In your minimal samples, you simply
redirect the request to another page. Could you add an example to show how
to properly send a dynamic response after parsing the request body?

in addition, when returning the http_callack function, what is the meaning
of return 0, 1, and -1?

Thanks,
Kun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20190313/957edaf8/attachment.html>


More information about the Libwebsockets mailing list