question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returns HTML instead of plain-text

See original GitHub issue

On MacOS curl cht.sh returns normal HTML page for me instead of a plain text version of the cheatsheet, however curl -q cht.sh works fine.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
chubincommented, Jul 13, 2018

Yes, the problem in your case is that curl uses this User-Agent string (so it is seen as Mozilla from the web server side). I don’t know why there is such a problem in Mac OS X, but maybe is is configured by default in ~/.curlrc. Could you please check it? Probably it is the case because it works with -q. So please check your ~/.curlrc and remove the user agent line from there. If you need it for some reasons, we can override user agent in the cht.sh script explicitly (but in that case you couldn’t query the service with curl alone).

I would remove the user-agent string from your ~/.curlrc if you do not really need it.

1reaction
chubincommented, Jul 12, 2018

Could you please check what user-agent uses your curl?

$ curl -vI rate.sx 2>&1 | grep User-Agent
> User-Agent: curl/7.52.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

API GET Request Returns HTML/Text instead of JSON
So far, I've got it connected to the server hosting my API, but I'm unable to get it to return JSON. Instead it...
Read more >
Change the message format to HTML, Rich Text Format, or ...
Change the format of a reply or a forwarded message​​ You can change a plain text message to HTML. In the message, click...
Read more >
3 ways to convert HTML text to plain text - DEV Community ‍ ‍
3 ways to convert HTML text to plain text · 1) Using .replace(/<[^>]*>/g, '') · 2) Create a temporary DOM element and retrieve...
Read more >
Why would a web page be displayed as plain text instead of ...
This question have two scenarios as asked. First: the text is shown because there might be some closing of tag issue, which causes...
Read more >
How to send an HTML message in reply to a plain text email
What's more, instead of your carefully designed HTML email signature, the recipient will just see its simple plain text version.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found