EldoS | Feel safer!

Software components for data protection, secure storage and transfer

RequestHeaders inTElHTTPSClient getting overwritten in POST?

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#6003
Posted: 04/23/2008 16:25:19
by Dennis Lee (Basic support level)
Joined: 04/23/2008
Posts: 1

Hi,
I'm using the class TElHTTPSClient to do a POST using HTTPS. The remote server is looking for specific data in the headers, so I set them using the following code:

request.RequestHeaders.Add("SP-Version", "2.5");
using (FileStream fs = new FileStream(@"C:\newpair.p12", FileMode.Open, FileAccess.Read))
{
cert.LoadFromStreamPFX(fs, "password", 0);
}

request.ClientCertStorage = this.memCertStore;
this.memCertStore.Add(cert, true);
request.OnCertificateValidate +=new SBSSLCommon.TSBCertificateValidateEvent(HTTPSClient_OnCertificateValidate);
request.OnReceivingHeaders += new SBHTTPSClient.TSBHTTPHeadersEvent(HTTPSClient_OnReceivingHeaders);

int res = request.Post(authURL, query);

Before I call the Post method, I have inspected the RequestHeaders property and it is in there. When the OnReceivingHeaders event is triggered, upon inspection of the RequestHeaders property, it is now missing.

Can you please tell me how to keep my addition to the request headers? This is of extreme urgency.

thanks,
Dennis
#6009
Posted: 04/24/2008 03:17:47
by Eugene Mayevski (EldoS Corp.)

Please don't crosspost to forum and helpdesk. Answered in HelpDesk.


Sincerely yours
Eugene Mayevski
#25203
Posted: 06/06/2013 04:52:28
by Kathrin Seemann (Standard support level)
Joined: 06/06/2013
Posts: 1

Hey Eugene,

i have exactly the same problem. Can u lead me to the answer?

Thx!
#25204
Posted: 06/06/2013 06:17:22
by Eugene Mayevski (EldoS Corp.)

RequestHeaders is cleared and rendered when you call a method. Then the object is passed to your code via OnPreparedHeaders event. In the event handler you can modify what has been prepared for the request.

Probably we should just remove RequestHeaders property at all to avoid confusion.


Sincerely yours
Eugene Mayevski
#37810
Posted: 09/28/2016 14:53:38
by Gabrielius Liaskus (Basic support level)
Joined: 09/28/2016
Posts: 1

Yes, that's indeed confusing.

Best regards,
Gabe
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

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