EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Better way to stream from TElHTTPSClient to TStringList?

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#20414
Posted: 06/11/2012 17:51:50
by Eric Lenington (Standard support level)
Joined: 12/06/2010
Posts: 37

I'm currently retrieving a name-value "file" via HTTPS. The way I'm going it seems like it could be improved: HTTPS--(via OutputStream)-->TMemoryStream->TStringList. Is there a better way that would eliminate the TMemoryStream? In other words, can I go directly from the HTTPS client component to the TStringList?
#20416
Posted: 06/12/2012 01:15:48
by Eugene Mayevski (EldoS Corp.)

Something like this:

Code
HTTPClient.OutputStream := TStringStream.Create;
HTTPClient.Get('');
MyStringList.Text := TStringStream(HTTPClient.OutputStream).Text; // I don't remember exact TStringStream's property name
HTTPClient.OutputStream.Free;


Sincerely yours
Eugene Mayevski
#20427
Posted: 06/12/2012 08:04:23
by Eric Lenington (Standard support level)
Joined: 12/06/2010
Posts: 37

Yes, that's essentially what I'm already doing. I was hoping to eliminate the extra step of the TStringStream, which essentially does nothing more than "double buffer" the content from the GET.

Reply

Statistics

Topic viewed 671 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!