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