cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP - code for POST method

Rick MC
Associate III
Posted on June 15, 2018 at 15:53

I created a webpage associated with the IP address of my Discovery board. The page allows you to choose a txt file and send it to the board. 

What I want to do is receive the txt file and read what is inside. I know I have to implement a code to match the POST method implemented in the webpage.

I think I have to use a function like httpd_post_receive_data() that I found in httpd.h but I don't know how to use it..

Is there any example that shows this part? or other ways to do it?

Thanks!

#stm32f7 #discovery #lwip
2 REPLIES 2
Tilen MAJERLE
ST Employee
Posted on June 15, 2018 at 22:38

Hello

marco.pirotta

‌,

one option is to use as you mentioned, but I would suggest you to go with NETCONN API and handle server with it.

In this case you need RTOS to handle multi-threading for you, but data processing will be linear and much more easier for you.

Please check for Netconn_server_RTOS examples in your favourite STM32Cube package. There is server for HTTP webpage and you may rewrite it to handlePOST instead ofGET in the first data packet.

Best regards,

Tilen

Rick MC
Associate III
Posted on June 18, 2018 at 16:10

Thanks for the advice

Majerle.Tilen

‌. Anyway I would like to avoid the use of RTOS since it is already a pretty big project.

Any other way to do it without an operating system?

I noticed functions such ashttpd_post_receive_data() orhttpd_post_finished() that may be suitable to my purpose. Does anyone know if these functions can be used and how to use them? (for example I don't know what the connection requested in input really is..)

Thanks!