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 的回复
于 2013 年 11 月 24 日 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 的回复
于 2013 年 11 月 24 日 11:35上午
Ahh thank you.
Cheers.