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 AM
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 AM
Ahh thank you.
Cheers.