I made an app over a year ago for getting movie info and it worked perfectly up until today. It just throws up an error "The remote server returned an error: (406) Not Acceptable."
It's been over a week since I used it and I was using the 2.1 API. I've been looking around the forum and I see that API has been removed and replaced completely with the 3 API so I'm assuming that must have something to do with my problem.
I'm using Visual Basic and searching for the film "mama" .Here's the code I had:
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(http://api.themoviedb.org/3/search/movie?api_key***&query=mama)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
I've now replaced it with:
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://api.themoviedb.org/3/search/movie?api_key=***&query="mama)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
When I type "http://api.themoviedb.org/3/search/movie?api_key=***&query="mama" directly in to the web browser it loads the page.
Any help would be much appreciated :)
찾으시는 영화나 TV 프로그램이 없나요? 로그인 하셔서 직접 만들어주세요.
이 항목을 평가하거나 목록에 추가할까요?
회원이 아닌가요?
mac님의 댓글
9월 22, 2013 at 7:17 오후
I sorted it.
Just added "request.Accept = "application/json" to the code.
Simple really! :)
Travis Bell님의 댓글
9월 23, 2013 at 9:56 오전
Yup :) Glad you sorted it out.