Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Michael Van Canneyt via fpc-pascal
On Tue, 28 Sep 2021, Anthony Walter via fpc-pascal wrote: For the benefit of others, there are a few problems with the FPC example to note. 1) The callback CURLOPT_WRITEFUNCTION should return the number of bytes handled. It does that ? Result:=TStream(Data).Write(Ptr^,Size*nmemb); Write

Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Anthony Walter via fpc-pascal
For the benefit of others, there are a few problems with the FPC example to note. 1) The callback CURLOPT_WRITEFUNCTION should return the number of bytes handled. 2) You should check the result of curl_easy_perform to determine if the curl perform operation (HTTP GET) was successful. _

Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Anthony Walter via fpc-pascal
Michael, You are right, they are very similar. I didn't know of the existence of the example to which you referred. Thank you for pointing that file out. I searched for it just now and took a look. One difference is that my example ignores certificates problems, but this difference is important in

Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Michael Van Canneyt via fpc-pascal
On Mon, 27 Sep 2021, Anthony Walter via fpc-pascal wrote: I was having some problems using vanilla sockets and OpenSSL to read a few specific web pages using HTTPS. Normally I don't have any problems using HTTPS, but with a few sites my code was not working. I ending up finding the RTL unit Li