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.
Can't find a movie or TV show? Login to create it.
Ma doonaysaa inaad qiimayso ama ku darto shaygan liiska?
Ma aha xubin?
Reply by Travis Bell
on November 24, 2013 at 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.
Reply by Gudui
on November 24, 2013 at 11:35 AM
Ahh thank you.
Cheers.