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.
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on august 22, 2014 at 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.