api - How to encode keywords for rotten tomatoes? -
i try query movie called kokowääh
rotten tomatoes api.
if put address bar in browser, result: http://www.rottentomatoes.com/search/?search=kokow%e4%e4h
but if send via api, no result.
http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=mykey&q=kokow%e4%e4h&page_limit=3
any idea why?
the rotten tomatoes api expects international characters in query parameters encoded using utf-8, , percent-encoded.
if @ i/o docs example page , ask generate url search "kokowääh", gen url like:
http://api.rottentomatoes.com/api/public/v1.0/movies.json?q=kokow%c3%a4%c3%a4h&page_limit=10&page=1&apikey=
here can see there 2 percent-encoded bytes per character, each couple of bytes utf-8 encoding of 1 character.
Comments
Post a Comment