EldoS | Feel safer!

Software components for data protection, secure storage and transfer

HTTPSServer - Sample to handle POST Requests

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#19552
Posted: 03/22/2012 02:27:36
by Bernd Schaaf (Standard support level)
Joined: 12/24/2011
Posts: 2

Hello,

where can i find a sample to Handle POST Requests with HTTPSServer? I´don´t understand how to get the postet data and how to give the right response to the back to the client. The HTTPSServer Sample only handles the GET Command.

I woluld be very happy for a little help.

Bernd
#19568
Posted: 03/23/2012 03:23:25
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for getting is touch with us.

If a POST request is received and it contains any data then TElHTTPSServer.OnData event will be fired one or multiple times until all data will be received. Then TElHTTPSServer.OnRequestBodyReceived will be fired to indicate that all request data is already received.

Quote
how to give the right response to the back to the client

This is demonstrated in the sample.
#27157
Posted: 11/05/2013 11:11:24
by Tim Frost (Standard support level)
Joined: 07/20/2007
Posts: 17

It seems from the Delphi source of TElHTTPSServer that while OnData is being called, the data is being quietly concatenated into the fInBuffer ByteArray. This seems wasteful since the array is not exposed in a property. It would be good to have an example of how best to modify the code to access this array from ServerThread.pas, to save having to duplicate the concatenation and storage overhead already in OnData and OnRequestBodyReceived events. The nest of classes is quite convoluted here and it is not clear to me how to make this field visible in my processing thread. I need to read it to determine where to save the content.
#27165
Posted: 11/06/2013 01:34:09
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

There is no sence to make FInBuffer a public property as it contains non-processed data: HTTP headers and body that may be compressed and/or chuncked. As you can see from the code the content of this buffer is splitted into headers and data and then the data is optionally decompressed and de-chunked. OnData is called only after above mentioned conversions and passes ready-to-use data to a user.

Reply

Statistics

Topic viewed 806 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!