Thanks Michael!
Looks like libwebsockets *is* ported to NuttX already - but you have to
enable MIT licensed software (and a few other things to do with TLS and
CRYPTO stuff) first, but it could well be an option: I'll take a look :-)
In the meantime I have a theory as to why the thttp CGI scr
Hi Tim,
you wrote:
> Anyone know of a lightweight webserver that will handle POST and that
runs under NuttX?
I was very impressed by libwebsockets, when I was using it on NuttX a
couple of years ago. It is not exactly lightweight, and much more than a
webserver, but it is a perfect infrastructure
Update as I am back on this after a break and still stumped.
uIP:
* only supports GET method
* HTML5 maps PUT to GET which is why I found either caused my CGI app
to run
* But no support for getting the data itself as...it only supports the
GET method
thttpd:
* supports POST, and cal
Make that "PUT" not "GET", of course.
On 05/06/2025 15:42, Tim Hardisty wrote:
And...the magic answer to make this form actually work with the uIP
webserver is that:
1. the form's "method" has to be GET not POST otherwise the URL CGI
"call" is not made visible/sent correctly/processed.
2.
And...the magic answer to make this form actually work with the uIP
webserver is that:
1. the form's "method" has to be GET not POST otherwise the URL CGI
"call" is not made visible/sent correctly/processed.
2. the webserver has to be configured with URL/CGI mapping enabled
(CONFIG_NETUT
Wow - thank you: very helpful indeed :-)
On 05/06/2025 11:08, Maciej Wójcik wrote:
This is how I implemented REST API with uIP in NuttX some time ago.
http.c
int format_header(char* buff, int status, int body_len) { if
(body_len > 0) {return snprintf(buff, HTTPD_MAX_HEADERLEN,
"HTTP/1.0 %
This is how I implemented REST API with uIP in NuttX some time ago.
http.c
int format_header(char* buff, int status, int body_len) { if
(body_len > 0) {return snprintf(buff, HTTPD_MAX_HEADERLEN,
"HTTP/1.0 %d %s\r\n" "Connection: %s\r\n" "Content-Length:
%d\r\n" "%s" "\r\n
To try and answer my own question...
It seems (and probably obvious, doh, to all but me) the uIP server only
serves pre-formatted html. No matter what "send" option you choose
(pre-formatted/sendfile/mmap) or the URL/CGI mapping option) the html is
pre-rendered. So NO chance of a form action t