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 :)
Non podes atopar unha película ou serie? Inicia sesión para creala.
Queres valorar ou engadir o elemento a unha listaxe?
Non es membro?
Resposta de mac
no 22 de setembro do 2013 ás 7:17PM
I sorted it.
Just added "request.Accept = "application/json" to the code.
Simple really! :)
Resposta de Travis Bell
no 23 de setembro do 2013 ás 9:56AM
Yup :) Glad you sorted it out.