I’ve used a microcontroller to develop the embedded web server and I’m not sure if I can download an Apache or any other server into my controller.
However, I’ve successfully implemented an HTTP interface and have been hosting web pages and handling & parsing the POST request data/payload at the embedded web server side.
The issue is coming when the web page contains any form type data to be submitted.
I receive the value(s) entered by the user on the web page but I'm not able to display the data properly on the web page sent by the embedded server.
That’s where there’s a major issue in linking C (freeRTOS) code (server side) and JS (client side).
How can a JS web client pull data from embedded web server (in freeRTOS) given that I have a successful HTTP connection established with the web page and I'm also able to host pages as mentioned above?
Currently I'm using axios but unable to figure out how to call a C function in the URL? As it's not possible to code in C without a function.
axios({
method: 'post',
url: 'getStatus.c',
data: sampleData,
headers: {'Content-Type': 'multipart/form-data' }
})
.then(function (response) {
console.log(response);
})