[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Best way to return JSON data for AJAX
From: |
Dave Nadler |
Subject: |
Re: [lwip-users] Best way to return JSON data for AJAX |
Date: |
Mon, 20 Apr 2020 14:58:55 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Thanks Marco and Adam for the
suggestions.
This works great:
- create a fixed local JSON file with SSI-include syntax for the
values to substitute (lwIP's included httpd processes JSON type
for SSIs).
- #define LWIP_HTTPD_SSI 1
- #define LWIP_HTTPD_SSI_MULTIPART 1
- #define LWIP_HTTPD_SSI_INCLUDE_TAG 0 // Otherwise, SSI
substitution leaves original tag in JSON/HTML as a comment
I did not address trying to create a
much larger file dynamically, though a short JSON could be
expanded arbitrarily if set up as above.
Also I didn't address
context-identification which may be required for multiple
connections and multi-part responses;
this part isn't obvious...
Thanks again for the help,
Best Regards, Dave
On 4/15/2020 12:17 PM, Dave Nadler
wrote:
Hi All - I'm looking for guidance on good ways to return JSON
data for use in a web page via AJAX.
I found a couple of threads discussing using SSI for this but
I'm unclear the overall approach.
For this application I don't need to worry about session IDs -
just need to return some JSON
data, in multiple chunks to avoid chewing up enormous memory in
prep.
Thanks in advance for any guidance (or even better an example!),
Best Regards, Dave
References:
https://lists.gnu.org/archive/html/lwip-users/2017-11/msg00137.html
http://lwip.100.n7.nabble.com/LWIP-HTTPD-SSI-MULTIPART-and-concurrent-HTTP-requests-td31266.html
--
Dave Nadler, USA East Coast voice (978) 263-0097, address@hidden, Skype
Dave.Nadler1