The content_length is zero in HTTPSRV_CGI_REQ_STRUCT, when i use "get" method

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The content_length is zero in HTTPSRV_CGI_REQ_STRUCT, when i use "get" method

955 Views
longma
Contributor I

I am designing a webserver in K60DN512, ther MQX is be used in this product.

I create a form in client and set the method="get", the program can run into the CGI callback function, but the content_length is zero in HTTPSRV_CGI_REQ_STRUCT, however i change the mothod to "post", the program can get the right value of content_length. I don't know why? Can you help me?

Tags (1)
0 Kudos
6 Replies

783 Views
karelm_
Contributor IV

Hi,

If you use GET method there is no entity send to server and thus the content_length is zero. All variables and their values are send as a query to the server in such case. The query string is accessible in variable the query_string variable in HTTPSRV_CGI_REQ_STRUCT. You have to parse this string to get variable values. Or you can use post, read the entity with HTTPSRV_cgi_read() and then parse it.

Best regards,

Karel

P.S: See HTML Forms and Input to get some detailed information about HTML forms.

0 Kudos

783 Views
longma
Contributor I

Thank you, I resolved this problem.

0 Kudos

783 Views
longma
Contributor I

Hi Garabo, I updated the MQX 4.0 to V4.1, but this problem remains.

0 Kudos

783 Views
longma
Contributor I

Thank you! I will try it.

0 Kudos

783 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Long Ma,

Could you please test with the latest MQX 4.1 release?

It was released one week ago. You can find in this link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX&fpsp=1&tab=Design_Tools_Tab

Please share your results.


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

783 Views
longma
Contributor I

Hi Garabo, I updated the MQX 4.0 to V4.1, but this problem remains.

0 Kudos