EldoS | Feel safer!

Software components for data protection, secure storage and transfer

RequestHeaders inTElHTTPSClient getting overwritten in POST?

Posted: 04/23/2008 16:25:19
by Dennis Lee (Basic support level)
Joined: 04/23/2008
Posts: 1

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.

Posted: 04/24/2008 03:17:47
by Eugene Mayevski (Team)

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

Sincerely yours
Eugene Mayevski
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?

Posted: 06/06/2013 06:17:22
by Eugene Mayevski (Team)

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
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,



Topic viewed 2772 times

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


Back to top

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

Got it!