[Libwebsockets] R: REST server

Stefano Mora stefano.mora at newdep.com
Fri Jan 11 17:04:49 CET 2019


Hi,
thanks for reply.

Now I’m able to setup the server and build some callbacks.
In my test I send some data by the REST plugin in Firefox browser: I’d like to reply a REST string against a POST request but the browser does not receive the reply.
This is my log:

-> LWS_CALLBACK_FILTER_HTTP_CONNECTION in='/prenotazione/nuova'
--> 24 - ContentType: 24 ='text/plain;charset=UTF-8'
--> 2 - ContentLen = 2 ='62'
-> LWS_CALLBACK_HTTP in='/prenotazione/nuova'
> LWS_CALLBACK_HTTP_BODY len=62 in='{
numeroDiConsegna : "123456789";
codice: "abcde";
note: "";
}'
> LWS_CALLBACK_HTTP_BODY_COMPLETION
> LWS_CALLBACK_HTTP_WRITEABLE
--> headers
> LWS_CALLBACK_HTTP_WRITEABLE
--> body
--> try_to_reuse

The received data are correct.
The code is based on a sample (https://github.com/warmcat/libwebsockets/blob/master/plugins/protocol_post_demo.c) that sends headers and body strings and then recalls lws_http_transaction_completed(wsi) as a final step.

What’s wrong in this procedure?

Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20190111/7bf6231c/attachment.html>


More information about the Libwebsockets mailing list