Libcurl update

122 views
Skip to first unread message

cod...@outlook.com

unread,
Dec 10, 2025, 8:17:44 AM (4 days ago) Dec 10
to Harbour Developers

I work with Harbour 3.2.

Are there any plans for updating Libcurl in Harbour.  I use it a lot and it works reliably. My problem is that I can not use multipart/form-data approach to send form fields, where one of several fields is curl file object (file content).  Or I do not know how to do it with current Harbour libcurl verision.

On internet i read that Libcurl mime approach is newer and better to use in this case than form-data approach.

Regards,

Simo.

Aleksander Czajczynski

unread,
Dec 10, 2025, 12:35:41 PM (4 days ago) Dec 10
to harbou...@googlegroups.com
Hello!

hbcurl builds against current libcurl fromthe source.
Patches for the missing features are welcome.

Can you point out which feature of curl is missing?

Best regards, Aleksander

cod...@outlook.com wrote:
Simo. --
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/4ccdc6f1-e842-44a4-90b7-84f788c0ca38n%40googlegroups.com.

cod...@outlook.com

unread,
Dec 10, 2025, 1:07:46 PM (4 days ago) Dec 10
to Harbour Developers

Hi Aleksander.

I do not have knowledge to say that some curl features are missing, but for some time I could not make to work next curl script with Harbour libcurl:

curl -X ‘POST’ \ ‘https://api.aaa.bbb.cc/public/documents/requests’ \

-H ‘accept: */*’ \

-H ‘Api-key: 5bedec80-079a-491d-9b1b-96c173ff24031’ \

-H ’Content-Type:multipart/form-data’ \

-F ’RequestId=20250310-001’ \

-F ’File=@despatch-advice0603.xml;type=text/xml’

I do not need to upload file, I need to send form-data with two fields, where second field is so called Curlfile object, as script shows.

I have tried several ways to prepare header (-H) and form data (-F) using boundary to prepare body. Header data are not problem, but I did not succedeed to prepare form-data.  When I use Postman, *same* script works as expected, but in Harbour I always get some Http 4xxx error. One my friend same script successfully send with PHP libcurl.

That is why I concluded that Harbout libcurl needs some update.

I must repeat: May be that I do not know proper way to prepare -F parts of script. 

Best Regards,

Simo.

Lailton Fernando Mariano

unread,
Dec 10, 2025, 2:47:12 PM (4 days ago) Dec 10
to Harbour Developers
I think that you are looking for the MIME functions,

You can try this one:


aPost := {}
AAdd( aPost, { "RequestId", "20250310-001" } )
AAdd( aPost, { "File", hb_memoread( "despatch-advice0603.xml" ) } )
...

curl_easy_setopt( pCurl, HB_CURLOPT_MIMEPOST, aPost )

cod...@outlook.com

unread,
Dec 11, 2025, 2:37:54 AM (4 days ago) Dec 11
to Harbour Developers

Hi Lailton Fernando Mariano.

I have tried with  curl_easy_setopt( pCurl, HB_CURLOPT_MIMEPOST, aPost ) .

I got error  "Variable does not exist: HB_CURLOPT_MIMEPOST".

I had similar advice to use MIMEPOST from Rodrigo Rossi, in thread https://groups.google.com/g/harbour-users/c/Zl5AQvj6pag/m/F8xFmNDGCAAJ . I did not succeeded.

I work with Harbour 3.2. I built it from source, with Curl, on 2021-04-21.

Do I need to renew my Harbour installation to use MIMEPOST ?

Best Regards,

Simo.

Lailton Fernando Mariano

unread,
Dec 11, 2025, 7:46:22 AM (3 days ago) Dec 11
to Harbour Developers
It is inside:
#include "hbcurl.ch"


#define HB_CURLOPT_MIMEPOST 269

It was added to harbour in 2024-02-09 20:56 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)


Regards,
Lailton

cod...@outlook.com

unread,
Dec 11, 2025, 11:44:45 AM (3 days ago) Dec 11
to Harbour Developers
Thank you Lailton Fernando Mariano.

I will build new Harbour installation and try with MIMEPOST.

Best Regards,
Simo.

cod...@outlook.com

unread,
Dec 13, 2025, 3:24:07 PM (yesterday) Dec 13
to Harbour Developers

Hi to all.

Meanwhile I found how to send Curl script with libcurl.

I explained how it happened on next link:   https://groups.google.com/g/harbour-users/c/Zl5AQvj6pag   

The truth is that I didn't know how to prepare -F parts of script in proper way.

Sorry for bothering harbour-developers group.

 

Best Regards,

Simo.

Reply all
Reply to author
Forward
0 new messages