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.
Film of tv-serie niet gevonden? Meld je aan om deze toe te voegen.
Want to rate or add this item to a list?
Not a member?
Reactie van Travis Bell
op 22 augustus 2014 om 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.