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 :)
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de mac
le 22 septembre 2013 à 19h17
I sorted it.
Just added "request.Accept = "application/json" to the code.
Simple really! :)
Réponse de Travis Bell
le 23 septembre 2013 à 09h56
Yup :) Glad you sorted it out.