Basic HTTP and Bearer Token Authentication

Try this one to push basic authentication at url: curl -i http://username:password@dev.myapp.com/api/users -H “Authorization: Bearer mytoken123” ^^^^^^^^^^^^^^^^^^ If above one doesn’t work, then you have nothing to do with it. So try the following alternates. You can pass the token under another name. Because you are handling the authorization from your Application. So you can … Read more

How to properly handle a gzipped page when using curl?

curl will automatically decompress the response if you set the –compressed flag: curl –compressed “http://example.com” –compressed (HTTP) Request a compressed response using one of the algorithms libcurl supports, and save the uncompressed document. If this option is used and the server sends an unsupported encoding, curl will report an error. gzip is most likely supported, … Read more

PHP cURL not working – WAMP on Windows 7 64 bit

Go to http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and download the cURL version that corresponds to your PHP version under “Fixed curl extensions:”. So if you have PHP 5.3.13, download “php_curl-5.3.13-VC9-x64.zip”. Try the “VC” version first. Then replace the php_curl.dll in ext folder. This worked for me.

curl -GET and -X GET

By default you use curl without explicitly saying which request method to use. If you just pass in a HTTP URL like curl http://example.com it will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT. If for whatever reason you’re … Read more

Content-Type header [application/x-www-form-urlencoded] is not supported on Elasticsearch

To fix this, add curl option -H ‘Content-Type: application/json’ This error is due to strict content-type checking introduced in ElasticSearch 6.0, as explained in this post Starting from Elasticsearch 6.0, all REST requests that include a body must also provide the correct content-type for that body.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)