Author Topic: fnParameterPost  (Read 8549 times)

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
« on: October 18, 2011, 08:35:14 PM »
Hi Mark,

Do you have any documentation on how tu use fnParameterPost ?


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3238
    • View Profile
    • uTasker
Re: fnParameterPost
« Reply #1 on: October 19, 2011, 02:12:08 AM »
Hi Hervé

This function is an internal function in the HTTP code and so is normally not needed to be understood.
It is used to pass plain text posted data to the application.

To activate plain text post support the define PLAIN_TEXT_POST needs to be enabled.

In fnHandleWeb() each received frame is passed to the application via the two possible events: POSTING_PARAMETER_DATA_TO_APP or POSTING_PARTIAL_PARAMETER_DATA_TO_APP.

In the case of POSTING_PARAMETER_DATA_TO_APP the application is receiving the complete post data in a single reception frame (often the case when posting a few parameters). The demo application sends these to the debug output since often plain text strings are posted but the content can further be parsed by the application to control things.

fnWrite(DebugHandle, (unsigned char *)ptrData, (QUEUE_TRANSFER)http_session->FileLength); // send to debug output

In the case of POSTING_PARTIAL_PARAMETER_DATA_TO_APP it means that the data is only a fraction of the complete posted data (eg. in case a complete txt file was being posted). In this case the application may parse each frame or it may save it to a file (frame by frame) or maybe save it into a buffer for parsing when it is complete. When the final frame is received it generates the event POSTING_PARAMETER_DATA_TO_APP so that the application knows that the reception is now complete.