karan / vocabulary

Golang package to get meanings, synonyms, antonyms and more for a word
MIT License
61 stars 9 forks source link

Invalid character #3

Open ghost opened 3 years ago

ghost commented 3 years ago

When calling the Wordnik API directly via cURL, I have no issues.

curl "http://api.wordnik.com/v4/word.json/test/definitions?api_key=$key"

However, running the sample program included, it doesn't work. When running it I get the following result.

2021/02/10 11:53:17 invalid character '<' looking for beginning of value

Edit: I just noticed that I included the wrong API for cURL, my bad.

ghost commented 3 years ago

So I looked to see what the tool got back and it was easy to see the issue.

<html>
<head><title>429 Too Many Requests</title></head>
<body>
<center><h1>429 Too Many Requests</h1></center>
<hr><center>nginx</center>
</body>
</html>

It still doesn't make sense how I could make requests fine with cURL but not this.

ghost commented 3 years ago

The issue seems to stem from the Glosbe API because when visiting https://glosbe.com/gapi/ through my browser, I also got a 429