I am new to this field. Can someone help me to proper convert this script to Clarion libcurl.
I have read messages from Mike Duglas and other, but did not succeeded.
According to examples I have converted my script to next:
When I try to run this example I always get message that it is failed to read file from local disk.
Where do I make errors ?
Please someone to help me.
Thank you in advance.
Best Regards,
Simo.
You should also trying sending the result codes returned by the calls to Debug as they may give you a failure reason e.g. res = curl.FormPost(...) debug out the value in ‘res’.
Thank you Carl !
I will review code for leading spaces.
Did I converted other parts of Curl script in proper way to Clarion libcurl ?
Best regards,
Simo.
I don’t see “filename” argument in your source curl script.
Also, FormPost and related methods are considered as depricated, use mime post approach instead.
This bit of code uploads a tiff file to a server. I may be missing something, but it does work. You will need to change the headers to match what your server is expecting. But this should get you going in the right direction.
Thank you Mike !
Reading messages here and documentation in github for libcurl somewhere I found examples with ‘filename’, so I used it.
I will try mime post approach.
Best Regards.
Simo.
Thank you John !
This is valuable code example for me on how to use mime approach.
I do not need to upload file, I must send XML file content along with RequestId as form fields.
I do not have problem with header part but with how to prepare form data fields, where in form I must have RequestId and content of testfile.xml.
Best regards,
Simo.
This is valuable code example for me on how to use mime approach
Glad it can help. It was cobbled together by reading every post on the news group with Libcurl in the title, studying the examples and the libcurl source, asked a couple of questions and then a lot of trial and error. What is really helpful is to have dbgview running. Libcurl posts everything it can to dbgview while it is executing. You will find a lot of valuable information and error codes in the output.