How do I POST JSON data with cURL?

You need to set your content-type to application/json. But -d (or –data) sends the Content-Type application/x-www-form-urlencoded, which is not accepted on Spring’s side. Looking at the curl man page, I think you can use -H (or –header): Full example: (-H is short for –header, -d for –data) Note that -request POST is optional if you use -d, as the -d flag implies a POST request. On Windows, things are slightly different. See the comment thread.

wget/curl large file from google drive

WARNING: This functionality is deprecated. See warning below in comments. Have a look at this question: Direct download from Google Drive using Google Drive API Basically you have to create a public directory and access your files by relative reference with something like Alternatively, you can use this script: https://github.com/circulosmeos/gdown.pl

Call to undefined function curl_init().?

If you’re on Windows: Go to your php.ini file and remove the ; mark from the beginning of the following line: After you have saved the file you must restart your HTTP server software (e.g. Apache) before this can take effect. For Ubuntu 13.0 and above, simply use the debundled package. In a terminal type the following to install … Read more

curl: (6) Could not resolve host: google.com; Name or service not known

Issues were: IPV6 enabled Wrong DNS server Here is how I fixed it: IPV6 Disabling Open Terminal Type su and enter to log in as the super user Enter the root password Type cd /etc/modprobe.d/ to change directory to /etc/modprobe.d/ Type vi disableipv6.conf to create a new file there Press Esc + i to insert data to file Type install ipv6 /bin/true on the file to … Read more

cURL to show response headers after submiting a file

Use -i From the cURL manual Note also: The first will show headers, followed by body. The second will send a HEAD request so can’t be used in your example as you’re POSTing data. Edit The header output using -i is echoed to stdout, the same as the request body so directing the response into a PDF file … Read more