CYW943907AEVAL1F Support for HTML Form Post

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChMa_3922746
Level 5
Level 5
10 likes received 10 likes given 5 likes given

I was looking through the forum for an example of how the CYW943907 eval board, when configured as an HTML server, could process fields from a form using "post".  I was able to follow the "application" example in the SDK which uses "get".  Any pointers on this one? Thanks!

0 Likes
1 Solution

Yes, I was looking at the "appliance" application.

Update: I was able to get a form POST to work by:

1) Employing a simple HTML form in the webpage (action ="/button_handler" method ="post") (I didn't use javascript/ajax).

2) The submitted text data length shows up in http_message_body->message_data_length, and the data is pointed to by http_message_body->data.  The data can then be parsed/processed as required.

The same idea pertains to uploading a file, also.  I can upload a file and parse it as well.

Thanks!

View solution in original post

2 Replies
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

I believe you meant the "appliance" application in demo directory of WICED for example of http server. There is no sample example for POST method, but you can build an application with post method considering the implementation of "demo.appliance". The ajax script(WICED-Studio-6.2\43xxx_Wi-Fi\resources\scripts\general_ajax_script.js) needs to be modified to send POST method, instead of GET. 

0 Likes

Yes, I was looking at the "appliance" application.

Update: I was able to get a form POST to work by:

1) Employing a simple HTML form in the webpage (action ="/button_handler" method ="post") (I didn't use javascript/ajax).

2) The submitted text data length shows up in http_message_body->message_data_length, and the data is pointed to by http_message_body->data.  The data can then be parsed/processed as required.

The same idea pertains to uploading a file, also.  I can upload a file and parse it as well.

Thanks!