Coder Social home page Coder Social logo

mercury13 / curl4delphi Goto Github PK

View Code? Open in Web Editor NEW
72.0 72.0 22.0 289 KB

A little libcURL binding for Delphi XE2+. Supports “easy” interface only. See wiki for more documentation.

Pascal 98.95% PHP 0.63% HTML 0.42%
curl-library delphi-xe libcurl network-protocols

curl4delphi's People

Contributors

mercury13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

curl4delphi's Issues

Mimetype issues

Hi,
I have been using your library happily to use curl with delphi.
I ran into a few issues when using SMTP and attachments.

  1. Function curl_mime_type. Your function requires a HCurlMime argument, but the curl function seems to need a HCurlMimeType argument.
  2. For curl_easy_setopt I could not use a TCurlMimeOption. (CURLOPT_MIMEPOST). I needed to add an overloaded version of the function curl_easy_setopt.

Running a diff on your latest source of Curl.Lib.pas and my adjusted version I get this:

1760c1760
< function curl_mime_type(part : HCurlMime; mimetype : PAnsiChar) : TCurlCode;
---
> function curl_mime_type(part : HCurlMimePart; mimetype : PAnsiChar) : TCurlCode;
2616a2616,2620
> function curl_easy_setopt(
>         curl : HCurl;
> 		option : TCurlMimeOption;
> 		data : HCurlMime) : TCurlCode;  overload; inline;
> 
3062a3067,3074
> function curl_easy_setopt(
>         curl : HCurl;
> 		option : TCurlMimeOption;
> 		data : HCurlMime) : TCurlCode;
> begin
>   Result := curl_easy_setopt_initial(curl, option, NativeUInt(data));
>   end;
> 

I wanted to let you know, it seems a good improvement to me to include this into your original.
Greetings, JP.

Add a json post request example

  curl := CurlGet;
  curl.SetUrl('https://empacser.now.sh/api/sync_proxy')
    .SetCustomHeaders(
      CurlGetSlist
        .AddRaw('Content-type: application/json')
        .AddRaw('Accept: */*')
    )
    .SetProxyFromIe
    .SetOpt(CURLOPT_POST, true)
    .SetOpt(CURLOPT_POSTFIELDS, TEncoding.UTF8.GetBytes('{"xyz": 10}'))
    .SetCaFile('curl-ca-bundle.crt')
    .SetUserAgent(ChromeUserAgent)
    .SwitchRecvToString
    .Perform;

Mapping to curl equivalent options

Hello,
Can you help me about following command

curl -vs -H "Accept-Language: bg" -H "Accept: application/json" --user a@b:12345 https://app.prolet.org/steps-beta/clients/generic/import.do -X POST -d "source_post_code=1000" -d "target_post_code=6000" -d "weight=1" -d "paidOnDelivery=true" -d "printFormat=nil" -d "include_price=true" -o d:\l2.pdf

as post me some code of delphi for this parameters
-d
-o

Thanks in advance.
Nikolay Neykov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.