I am trying to access the API using the following code:
HttpResponse<Root> jsonResponse = Unirest.get("http://api.themoviedb.org/3/discover/movie")
.header("api_key", API)
.header("adult", "false")
.header("vote_count.gte", "5")
.header("release_date.lte", endDate)
.header("release_date.gte", startDate)
.header("page", page.ToString())
.asJson<Root>();
return jsonResponse.Body;
and I get a 401 response but I don't understand why. I am sure that my api_key is correct.
找不到电影或节目?登录并创建它吧。
Travis Bell 的回复
于 2014 年 08 月 22 日 12:04下午
Hi leo.sutton,
I'm guessing it's because you're passing the values in as a header as opposed to a HTTP parameter.
Cheers.