The api hates Bojack Horseman

poboxy wrote 6 years ago: 1

curl -s "http://api.tvmaze.com/search/shows?q=Bojack" WORKS

curl -s "http://api.tvmaze.com/search/shows?q=Horseman" WORKS

curl -s "http://api.tvmaze.com/search/shows?q=Bojack Horseman" DOES NOT

$ curl -s "http://api.tvmaze.com/search/shows?q=Bojack Horseman"
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>

poboxy wrote 6 years ago: 1

Yup ended up using:

parameters="${*}"
parameters=${parameters// /+}


Jan wrote 6 years ago: 1

Closing thread. Not an actual bug. :)


david wrote 6 years ago: 1

FWIW, I would look into a proper urlencode function/library; otherwise you're going to run into the same problem with other "special characters" as well.

Try 30 days of free premium.