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
дана 22. август 2014. у 12:04 PM
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.