Jump to content
A.M. Hoornweg

THTTPReqResp.OnBeforePost breaking change

Recommended Posts

Hello all,

 

I'm trying to port an older (Delphi XE) SOAP client application to Delphi Rio.  I'm stumbling upon a breaking change in THTTPReqResp, which is used by tHTTPRio.  The signature of the event THTTPReqResp.OnBeforePost has changed completely. 

 

Formerly the signature was:

 

  TBeforePostEvent = procedure (CONST HTTPReqResp: THTTPReqResp; Data: Pointer);

 

My routine does some manipulation of the http headers, for example it calls wininet.HTTPAddRequestHeaders(Data, ...) to allow gzip encoding and wininet.InternetSetOption(Data,....) to accept an invalid/self-signed SSL certificate.

 

 

The new signature of the event has become:

 

  TBeforePostEvent = procedure(const HTTPReqResp: THTTPReqResp; Client: THTTPClient) of object;

 

and now I'm stumped. How can I achieve the same as before? I want to accept gzip encoded data and I want to accept self signed SSL certificates.

 

Kind regards,

Arthur

 

 

Share this post


Link to post

Hello,

I have the similar problem like A.M.H. has, just from 10.2 to 10.3. I update last week to 10.3.2 and the problem is still there... Any idea how to solve it?

 

Thx

Tchinny

Share this post


Link to post

@A.M. Hoornweg, did you checked THttpClient API ?

  • accept gzip encoded data: set THttpClient.AutomaticDecompression to [THTTPCompressionMethod.GZip]
  • accept an invalid/self-signed SSL certificate: set THttpClient.OnValidateServerCertificate to event handler which optionally can analyze Certificate and set Accepted to True / False
  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×