0

I am sending the curl syntax like below format to get the authorization code value

D:\>curl -k "https://login.mailchimp.com/oauth2/authorize-post" -H "Host: login.mailchimp.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "Referer: https://www.httpsnow.org/?code=fa4b17caac5cdef9d6a88250d320a9b5" -H "Content-Type: text/plain; charset=UTF-8" -H "Origin: https://www.httpsnow.org" -H "Connection: keep-alive" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data "username=mailchims&password=Mailchimp"%"403" 

curl: (6) Could not resolve host: login.mailchimp.com

D:\>curl -k "https://login.mailchimp.com/oauth2/authorize-post" -H "Host: login.mailchimp.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "Referer: https://www.httpsnow.org/?code=fa4b17caac5cdef9d6a88250d320a9b5" -H "Content-Type: text/plain; charset=UTF-8" -H "Origin: https://www.httpsnow.org" -H "Connection: keep-alive" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data "username=mailchims&password=Mailchimp"%"403"

▼ ♥☻   ♥ D:>

How to avoid special characters when getting result set? In above output you can see the love symbol at the bottom. Correct my sysntax if i am doing wrong please

2 Answers 2

1
curl --compressed
--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.

How to properly handle a gzipped page when using curl?

explainshell.com

1
  • Thanks for your reply. I have tried with your command but i face similar result as special characters when redirecting to file.txt Commented Nov 30, 2014 at 7:28
0

It seems that the result is a gzip and hence you see the special characters. You could save it in a file and use the silent settings to disable anything in the screen.

Append the following to the curl command line that you have l:

-o [filename] --silent

Replace [filename] with the name of the file to save the response to.

11
  • Thanks for your reply. But after trying with your suggestions and saved as txt file in some location then i got result like "‹ ÿÿ " Commented Nov 30, 2014 at 7:22
  • Can you please suggest me how to solve my issue to remove special characters when it is redirected to ouput Commented Nov 30, 2014 at 7:24
  • After hitting that above command in the command line i am getting from the browser is "httpsnow.org/?code=4a7322434415d9377a6b76d47171ccb4" but when i am running using curl it shows special characters in the redirected output as filename.txt (‹ ÿÿ ) Commented Nov 30, 2014 at 7:26
  • Surprising, I do not get anything on the screen after appending that to the curl command.
    – Khanna111
    Commented Nov 30, 2014 at 7:36
  • Are u trying with my above url Commented Nov 30, 2014 at 10:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.