Click here to Skip to main content
15,885,197 members
Everything / cURL

Curl

cURL

Great Reads

by Michael Haephrati
Minds.com is a blockchain-based social network where users can earn money or cryptocurrency for using it.
by Daniel 11317535
Steps to automate application exports for case360 using cURL
by Michael Haephrati
How to use an OCR SDK using C++ and libCurl
by Michael Haephrati
Possible ways to use a Proxy Server within a Windows C++ application

Latest Articles

by Michael Haephrati
Minds.com is a blockchain-based social network where users can earn money or cryptocurrency for using it.
by Michael Haephrati
Possible ways to use a Proxy Server within a Windows C++ application
by Michael Haephrati
How to use an OCR SDK using C++ and libCurl
by Daniel 11317535
Steps to automate application exports for case360 using cURL

All Articles

Sort by Score

cURL 

6 Apr 2017 by Patrice T
Quote: I have purchased an API. I don't know how to work with it exactly. Do you mean they don't help their paying customers ? there is not much possibilities: you can get help from other users preferably on a users forum. You should get help from authors, if they don't help, ask your money...
5 Dec 2013 by AsthaS
Hi all,I want to create a post request and send it to server using libCURL can anyone help me in that.If this is my sample request/WCS_Capabilities/Capabilityhow am I suppose to set the xml...
4 Feb 2014 by Philippe Mori
As mentionned in solution 2, there are some memory leaks. Any memory allocated by new or new[] should be released by delete (or delete[] respectively.And also inspired by that solution, you might have a difference between the reported file size and the actual required size like the exact...
17 Jun 2014 by DrGrim
Hello ! I have this piece of code : require_once("Xpath.php"); //ini_set('xdebug.max_nesting_level', 200); scrape("http://filmehd.net/page/1"); set_time_limit(0); function scrape ($url) { $xpath = new XPATH($url); $get_image_src =...
19 Jun 2016 by Jochen Arndt
For a single application (the only application using these dependencies) add the properties to your project:C++ - General - Additional Include Directories: "C:\Program Files (x86)\CURL\include"Linker - General - Additional Library Directories: "C:\Program Files (x86)\CURL\lib"Include...
11 Jan 2017 by Jochen Arndt
So you have adopted the example from libcurl example - smtp-mail.c[^] and modified it.One of your modifications is related to the mail content which is created by the callback function. So the problem is obviously located there. A candidate would be the lines_read variable. But you did not...
28 Sep 2017 by TimGallin
Seems I have found a solution.I print these variables out and I found the Microsoft Official solution is not suitable for me.On my computer the matched directory's name is v7.1A,not 7.1A. And after I finished set vsvars32.bat I found there is no variable named "CL",so I just set CL equal to...
21 Feb 2018 by Richard MacCutchan
Your declaration of -DCURL_STATICLIB means you will use the static library, but you then try to link to the dll. If you use that declaration then you need to specify -lcurl not -lcurldll.
19 Jun 2022 by tracam
Hi, I am using libcurl to send SMTP emails from a ubuntu server. I have been asked to change the emails to have a HTML body from a temple stored in a file. Is libcurl able to send the HTML body and if so any advice or example on how to achieve it would be appreciated....
12 May 2019 by Michael Haephrati
This example[^] might help. Curl fully support HTML in email's body.
27 Mar 2020 by Member 10042484
Hi All, I want to connect to google drive to display/download/upload files using username and password through c++ project. I was trying to use curl library to achieve this, but i was not successful in doing this. Could anyone help/guide me in achieving this? The main issue is to login to user...
27 Mar 2020 by Michael Haephrati
You should check 2 plages: 1. Google Drive API[^] 2. Libcurl API[^] You can also learn the basics of communicating with this (and other) API's using REST, so you can choose other wrapper libraries or write your own. Many things has changed...
17 Aug 2020 by OriginalGriff
You have to escape double quotes within a JSON string: {\"c_id\":\"487672\",\"amount\":10} But ... to get it through the CMD processor as well, you may have to additionally escape the escape character:...
17 Aug 2020 by Bullgill Coder
It's not pretty, but I've added the following line in to put the quotes back in... jsonContent = jsonContent.Replace("'{", "{'").Replace(":", "':'").Replace(",", "','").Replace("}'", "'}"); I've done this right before I deserialise and it is...
2 Nov 2020 by Richard Deeming
Your array creation syntax looks nothing like the documentation: PHP: Arrays - Manual[^] The closest seems to be the new syntax from 5.4.0: PHP: New features - Manual[^] That would still need to be: $post = [ "no_pengajuan_full_day" =>...
2 Nov 2020 by Richard MacCutchan
Your syntax is incorrect for the declaration of $post. The correct way to specify arrays is detailed at PHP: Arrays - Manual[^]. Also take careful note of Richard Deeming's comment.
26 Feb 2021 by Michael Haephrati
Minds.com is a blockchain-based social network where users can earn money or cryptocurrency for using it.
23 Oct 2021 by User 15365431
Hi, I'm trying to setup crypto payments using coinbase commerce but I'm having a hard time returning the hosted URL, The charge.php file seems correct but the button on my checkout.html page is not fetching the information from charge.php. The...
1 Nov 2021 by Richard MacCutchan
It is because of the uncontinued blank line and the single quotes around $password. The following works*: curl "https://somewebsite.com" \ --request POST \ --header "Accept:application/json" \ --header "Content-Type:application/json" \ --data...
3 Mar 2022 by CPallini
What about 'The Documentation' (libcurl - API[^]) ?
3 Mar 2022 by Richard MacCutchan
Quote: I'm not much familiar with the cURL. Then you will need to learn how to use it: see curl[^], or find an alternative solution.
12 Jun 2023 by Richard MacCutchan
I have made a couiple of minor modifications to your command (not curl) script as follows: @echo off if NOT "%1" == "" GOTO continue ECHO Required parameter missing GOTO :EOF :continue SETLOCAL set host1=http://192.168.0.254 set...
13 Feb 2024 by Richard Deeming
Applications which are not running "elevated" do not have write access to the Program Files / Program Files (x86) folders by default. This has been the case for many years. You need to choose a better location to store the files you want your...
22 Jul 2013 by kvamshik89
Hi, How can I check, server availability at a particular IP address.When am directly using cURL to pass arguments to server, and do some operation, its taking really long time to through error if server is not available.Some solution please..Thanks and regardsVamshi
7 Oct 2013 by xiaohan2012
Recently I am using cURL to crawl the recommended question list from stackoverflow.com based on my signedin account.Currently, in order to register my account info in the HTTP request, I copy and paste the headers+cookies(displayed by my browser) into a file, wrote a script in which curl is...
25 Oct 2013 by Member 10322654
Hi , I am trying to access "https" server using xml+soap but every time i am getting 411 error saying Length Required, data should be chunked or length required ....Please find my code below here i am providing Content-Length for specifying length and Transfer-Encoding for chunked data...
5 Dec 2013 by Aescleal
The simplest way is three calls to curl_easy_setoptCURLOPT_POST tells the library that you're going to do a post.CURLOPT_POSTFIELDS tells the library that this is a pointer to the data that you want to send in exactly the form the server expects it. It's up to you to make sure that this...
4 Feb 2014 by ansh_kumar
I'm successfully able to send email using libcurl from visual c++ (in debug mode), but when I use release mode I'm getting following error:> MAIL FROM: SIZE=22322250707370015
4 Feb 2014 by ansh_kumar
I've finally found a working code and found where the buffer was overflowing but I still need some explanation how it's happening.First my correction to the code:In function read_file()...buffer_size += fileSize;...buffer_size += ADD_SIZE;... strcpy(fileBuf[len++],"To: "...
28 Apr 2014 by Ravimal Bandara
The best solution is use an HTML parser in client side so you can filter out the message. If it is complex you can simply wrap your message with a tag which is not used in HTML. Check the following example,hello wordnow you can find for the content within the ...
19 Apr 2015 by Spatika007
Could anyone tell me how to download a pdf file in server through ftp curl to a designated file on my Linux PC using username and password.I tried following code but it doesn't download and ends up time out case.curl -o username:password 'ftp://website.com/sample.pdf'
18 Nov 2014 by Member 11243247
I need to transfer a certain file to a SFTP along with private key and passcode for private key. I am using following curl command format but I am getting curl error code 7:couldn't connect to host. Please have a look at below curl command and suggest what am I doing wrong here. Thanks a...
23 Nov 2014 by ansh_kumar
The code bellow uses Imagemagick++http://www.imagemagick.org/Magick++/[^] to base64 encode the image.#include #include #include #include #include #define FROM ""#define TO ""#define...
24 Nov 2014 by Member 10896619
Hello, Friends I am using following code to send a mail but here the body of mail is statically defined but i want to send some variable values like UserNamemail and Passwordmail. Here if i declare UserNamemail="sljfgsg",Passwordmail="lksdhfi" then my mail going successfully but my value for...
23 Nov 2014 by Richard MacCutchan
You add variables exactly the same as you add static values, by writing the variable names in the code.
4 Dec 2014 by tanya de la merced
Hi guys, I'm actually developing a project which I will get all the data from a particular website and export it to excel. Does anyone created a php project similar to mine? Please do help me on how to develop it. On the project that i am currently doing, the details can be viewed(details from...
8 Feb 2016 by Daniel 11317535
Steps to automate application exports for case360 using cURL
18 Apr 2015 by Member 11393768
Can someone help me to understand how to do this API thing? The problem is, it doesn't display an output. Then, I have learned that the GET is not really needed(can be there or not) to be part of the code, but in this case, when I am deleting the GET I am getting an error output. This:
22 Feb 2015 by Member 11380284
I have this curl request which I've been able to cobble together from various tutorials, and it works, but I need to be able to do it in C#.curl -K myconfig.cfg http://myserver/servlet which reads config file from stdinwhere myconfig.cfg is a configuration file with some name/value...
22 Feb 2015 by Zoltán Zörgő
Curl is not a command, it is an executable. But also a library! You better look for a wrapper around that library. Like this one: https://github.com/masroore/CurlSharp[^], bout you might find more out there.
22 Feb 2015 by Member 11377605
I am banging my head against a wall trying to convert a working curl command to a c# WebRequest.I have read through quite a few postings but didn't get satisfactory answerHere is the working curl command:curl -K pathtoconfigfile http://myserver/someservlet which processing the post...
18 Apr 2015 by Jems_007
Callback URL :curl https://na1.Host.com/services/data/v20.0/sobjects/Account/ -H "Authorization: Bearer token -H "Content-Type: application/json" -d "@newaccount.json" -X PATCH Example request body newaccount.json file{"Name" : "Express Logistics and Transport"}I want to call web...
7 Sep 2017 by Karim Pazoki
I'm a beginner in Codeigniter.I use CI 3.0 (last version).I wanna use recaptch in my code.When I search in google for curl class in codeigniter I find this code$this->load->library('curl');but when I use this in my codeUnable to load the requested class: Curland reality there isn't...
7 Jun 2015 by Richard MacCutchan
You first need to install the library on your system; see http://curl.haxx.se/[^].
2 Nov 2015 by Member 10308543
Hey guys,I am working on an Illustrator extension project which uses HTML5 for UI and JavaScript for implementing functionalities.Apart from HTML5 I am also using JQuery and AngularJS.Illustrator SDK has an special feature where you can execute a process using it.I need to pack a PDF...
15 Mar 2016 by Member 10305620
I am trying to compile Libcurl for my project but I am getting below error.g++ -g -o Main.exe Main.o L"C:\Test\src\WebSocket\lib" -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -DCURL_STATICLIB -llibcurl /mingw32/bin/ld.exe: cannot find -llibcurlWhen I built libcurl usinf mingw32 I got...
15 Mar 2016 by Richard MacCutchan
If you look closely at the Link Options - Using the GNU Compiler Collection (GCC)[^], you would see that the option should be -lcurl.
29 Mar 2016 by Member 11179782
the last bit of my php code looks like this: $curl = curl_init("../s/r.asp"); // the URL that processes your POSTcurl_setopt($curl, CURLOPT_POST, true); // use POST methodcurl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json")); // set POST...
16 Jun 2016 by AdamDedanga
So, I'm trying to fetch API-data using cURL, but I get the message "fail" from the else-statement in the code below. The API call is Google geocode for fetching coordinates.The code:
19 Jun 2016 by Member 3018373
I'm writing a very simple program in MS Visual Studio Community 2015 that uses cURL. cURL installs header files here:C:\Program Files (x86)\CURL\include\curlA little embarrassing, but I cannot figure out why MS Visual Studio cannot find include file curl.h which is in that...
19 Jun 2016 by KarstenK
You are on the right track, but it looks like you use the wrong library.Take a look at the discussion at stackoverflow because they use antoher and additional libraries and on the original sample code from curl.
18 Sep 2016 by David_Wimbley
So you're a script kiddie who wants help with the hax0rz? My suggestion, learn how to program, then learn PHP, curl, and how to use curl within PHP. PHP Tutorials[^]Use curl in php[^]If you have a legitimate issue that isn't finding assistance trying to access secure servers/services...
29 Nov 2016 by Jan Aranas
Hi i have this series of code i can grab data from voluum server but the problem is i cant alter anything when using PUT i dont know if i have the right syntax for server request to altertoken; $id = 'asdafewfcs'; $karon = date("Y-m-d"); $datetime = new...
11 Jan 2017 by Member 12890589
I am new to CURL and I am trying to send a dynamic message body. But I receive only an empty subject and message body when I attempt to use CURL lib in visual c++.Please help.What I have tried: size_t Process::processmail(void *ptr, size_t size, size_t nmemb, void *userp) ...
8 Feb 2017 by Surjeet Nandi
GitHub - philsturgeon/codeigniter-curl: THIS IS NO LONGER MAINTAINED, USE http://docs.guzzlephp.org INSTEAD[^]add this lib. in CI
17 Feb 2017 by Dinesh92
Hi,Good morning all.I have a mobile web application in php. There is a field for mobile number to be entered and after clicking OK, an OTP is sent to that number to get further access to application.Current scenario is user have to see the sms and get the otp from sms and enter it...
22 Feb 2017 by TimGallin
os:win7-32 vc10first I use "perl configure no-shared VC-WIN32",then nmake,nmake test and nmake install.It works well,I got the directory openssl in "c:\\program files" and ssl in "c:\\program files\common files".I used the openssl to build static curl 7.52.1,my curl build command is nmake /f...
26 Mar 2017 by Member 13086409
URL and cURL access different when accessing a web aPI. Am I missing headers or something because the cURL php only outputs "''" rather than the URL output from belowWhat I have tried:I have this URL access :...
5 Apr 2017 by Testieaccou
here is a shell script which takes domain and its parameters to find status code . this runs way faster due to threading but misses lot of requests. if i ran normally it process all requests but the speed is very low. is there a way through which speed is maintained and it also not misses all...
6 Apr 2017 by Jeremy Falcon
Also, in addition to their API support, read curl's man page... curl - Manual[^] curl - How To Use[^]
7 Sep 2017 by Member 13398523
PHP CURL to CodeIgniter controller - Stack Overflow[^]
6 Sep 2017 by Member 13397793
I have trying calling a soap of TCS through postman and it works fine there the only problem occurs when i am trying to call it through code getting this error: "Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1" What I have tried: This is my...
23 Nov 2017 by Member 13538121
The web address. tracker.ets2map.com/v2/fullmap Contains the data the data which I want to get. I then wish to format this data into the form in the document shown below. [snowball-gaming.com/2json.php] How could i go about doing this? I have tried several methods to retrieve the data, but...
6 Jan 2018 by Member 12825432
I i am tryng to make a website that get the car parts of a selected vehicle model, i get the values like the engine, air filter, oil filter and i want to make a table like the one that is on the website that containt this informations. This code works but i dont know how to format a table...
4 Feb 2018 by Member 12857222
I create web service to save data in database public string SaveData(String resultData) //save data to database { DLR service = new DLR(); Context.Response.ContentType = "application/json"; string filePath = Server.MapPath("~/Error.txt"); using (StreamWriter writer = new...
21 Feb 2018 by Member 13536260
Hello, i hope I get answers here, since this problem been bugging me since yesterday. I created a small code, using curl, I downloaded the library and put it in the mingw "lib" directory (libcurl.a and libcurldll.a), then I compiled my code with this option gcc MyCode.c -DCURL_STATICLIB...
12 May 2018 by caspianweb online
I can't save the output data of this class using php in databases
11 Nov 2018 by Member 14051386
I have a PHP script that will let you add a dynamic subdomain in cpanel from godaddy. But the problem is not adding a subdomain to the cpanel. Any advice or help will be much appreciated thank you. What I have tried: $whmusername = "sample"; $whmpassword = "@sample"; $subdomain =...
21 Mar 2019 by PIEBALDconsult
At work, I'm trying to access Splunk via the REST API using C#, but all the examples in the documentation use CURL and never show the resultant URL and body data. I can't install CURL at work, but I just downloaded it on my home PC. I would want to try using CURL on my home PC to see what it...
10 Apr 2019 by Haseeb A. Basil
The reason you are getting 1 is because of the following line: echo print_r($result); You see, how you are using `echo` and `print_r`, so in this case `print_r` is returning `true` which is being typecasted into integer and is being printed as `1` by `echo`. So, just remove that and it...
10 Apr 2019 by Member 3722539
I have been working for hours to get this works the problem is that when I first execute this code everything is ok but second time nothing displays. Then I realized that if I wait 20-25 seconds gets executed as expected I am using this way whois("google","web.tr") I dont get any...
11 Apr 2019 by phil.o
You function getData does not return anything, instead it does a print_r() call. You may try return $result; instead.
18 May 2019 by Gerry Schmitz
Quote: The url belongs to a camera You need to read the instructions that came with the "camera". Like, what "message" to send to get what you want.
17 Jul 2019 by Joan M
Hi all, I'm trying to control a tp-link electrical socket from the command line... By now I've done interesting progresses, being able to get the plug id... Now I'd like to go a step further and activate or deactivate it. In order to do that I've followed an Internet page that explains how...
17 Jul 2019 by Joan M
curl -X POST -H "Content-Type: application/json" -d "{ \"method\" : \"passthrough\", \"params\" : { \"deviceId\" : \"80067AC4FDBD41C54C55896BFA28EAD38A87A5A4\", \"requestData\" : '{ \"system\" : { \"set_relay_state\" : { \"state\" : 1 }}}'}}"...
20 Feb 2020 by Member 12899279
i am using curl and its getting test data fine but i am unable to send the data from it to my php script c++ code i am using is taken from curl post examples which is: CURL * curl; curl_global_init(CURL_GLOBAL_ALL); CURLcode res; string data1...
20 Feb 2020 by Member 12899279
got it working with these changes Php changes:- $data1=mysqli_escape_string($conn,$_POST['data1']); $name=mysqli_escape_string($conn,$_POST['name']); $project=mysqli_escape_string($conn,$_POST['project']); C++ code changes:- string data1...
10 Jun 2020 by Member 9179307
Hi, I'm experimenting with cURL and get the following error when I start the debugger: Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/RASPBI~1/bin/Debug/RASPBI~1.EXE done Setting breakpoints...
10 Jun 2020 by Richard MacCutchan
See Non-debug DLL Symbols - Debugging with GDB[^].
17 Aug 2020 by Bullgill Coder
Hi, I've written an API in c# that updates a SQL table. The API passes JSON to the code. If I run the API through Postman the code works correctly and updated the SQL table, but if I run through a CURL command I get the "Object reference not set...
13 Aug 2020 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a...
13 Aug 2020 by Dave Kreskowiak
Well, the first thing I see with your controller is that it assumes the "value" passed into the method is not null and contains valid data. You do no validation of the "value" at all. ...and this leads to the error you're getting. In Postman,...
17 Aug 2020 by Bullgill Coder
I am receiving from another website a curl request with json. An example request would be curl -X PUT -H "Content-Type: application/json" -d '{"c_id":"487672","amount":10}' http://xxxx/api/b2 This is just some test code to try and see the...
17 Aug 2020 by Bullgill Coder
I've managed to get things working by changing my code to a HttpRequestMessage [HttpPut] public void Confirmation(HttpRequestMessage request) { var content = request.Content; _conPU = new...
27 Jan 2021 by RickZeeland
curl -X POST -F 'username=xxx' -F 'password=something' -F "data={\"propery1\":\"value\"}" https://localhost:44333/action
2 Apr 2021 by wifinut
I'm looking for a method to obtain my provisioned ISP bandwidth via shell script. To be clear, I'm not looking to do a speed test. My goal is the following: 1. Get my provisioned bandwidth (up/down) 2. Run a test to obtain the percentage of...
2 Apr 2021 by Dave Kreskowiak
The only way to get your bandwidth is a speed test. There is no information stored on your machine or any standard method on the internet to get your provisioned bandwidth.
9 Aug 2021 by wifinut
I'm trying to use Linux CURL command in my shell script where I make a conversion from Bps to Mbps to get the internet speed. However, the speed is not accurate. For example, my 100MB internet connection shows initially ~83Mbps. If I run the...
14 Sep 2021 by Richard MacCutchan
You cannot refer to cookies immediately after setting them like that; see PHP: setcookie - Manual[^].
14 Sep 2021 by Richard MacCutchan
The same reason as in your previous post of this question at Not able set the cookies getting the undefined index error.[^]. Please follow the link I gave you and study why the setcookie method does not immediately set the value in the $_COOKIE...
14 Sep 2021 by OriginalGriff
Repost: Deleted. Please do not repost your question; use the Improve question widget to add information or reformat it, but posting it repeatedly just duplicates work, wastes time, and annoys people. I'll delete this one.
2 Nov 2021 by User 15365431
Hi, I am using async/await to fetch a file (createCharge.php) that contains arrays with data inside. Here is my html page that has the that fetches the createCharge.php file arrays data, the createCharge.php also creates a 'hosted_url'...
1 Nov 2021 by wifinut
I'm trying to pass a defined variable in a BASH CURL command. I can't seem to get the single quotes or double quotes correct and it results in an error: line 22: --user: command not found Hardcoding the value is no problem. What I have...
2 Nov 2021 by Richard Deeming
Your PHP script is returning the URL as text. Your newurl variable will be a string containing the URL. It doesn't have a property called hosted_url, so newurl.hosted_url will be undefined. You haven't declared a variable called hosted_url in...
25 Jan 2022 by Member 15513062
I tried to increase the no. of records per run and computed for records/sec == throughput, ofcourse given the time_total. And expect curl to increase throughput per run, which explains the increase per run, in this case. When i plot Bytes...
16 Jun 2022 by Member 15136862
You must include MIME-Version as well as Content-Type, for example this will work, assuming every line ends with "\r\n". MIME-Version: 1.0 Date: Thu, 16 Jun 2022 14:12:05 +0000 To: Test From: Info ...
25 Oct 2022 by İsmet Özdeş
Hello How To Generate HTML Table from Curl Response ? my code ...
15 Nov 2022 by OriginalGriff
There is nowhere near enough information here for us to begin to help you - we have no idea what you are trying to do, or where you are starting from. We have no idea what you code looks like, or what might be happening when you try to run it....
3 Apr 2023 by Member 12899279
Please don't give links of curl documentation or examples as they are very old and confusing i just need a very simple example in which if i send files of type .docx or .pdf from c++ to my php script i can save them in folder on php server What...
12 Jun 2023 by Earl Livingston
Warning, Noob when it comes to scripts, but I have a problem with the script below-using cURL. curl -L "%host%/cm?cmnd=Power%con%%%20On" The Above code does not execute. %host% does not work but if I enter the IP address or %host1,2,3,..% it...