Im trying to make a search request, but I'm getting the 401 error.
var request = (HttpWebRequest)WebRequest.Create(string.Format("http://api.themoviedb.org/3/search/person?api_key={0}?query={1}", "myapikey", "Batman the dark night"));
request.Method = "GET";
request.Accept = "application/json";
request.Headers.Add("Accept-Charset", "UTF-8");
request.ContentLength = 0;
string responseContent;
using (var response = request.GetResponse() as HttpWebResponse)
{
using (var reader = new StreamReader(response.GetResponseStream()))
{
responseContent = reader.ReadToEnd();
//Console.WriteLine(responseContent);
}
}
What is wrong..
I can easly make a move request without any problems.
Не можете найти фильм или сериал? Войдите на сайт, чтобы добавить его.
Хотите поставить оценку или добавить в список?
Нет аккаунта?
Ответ от Travis Bell
, 24 ноября 2013 в 11:34
Hi Gudui,
Looks like you're not specifying your HTTP params properly. You need with your second and third
?
to&
like so:Cheers.
Ответ от Gudui
, 24 ноября 2013 в 11:35
Ahh thank you.
Cheers.