Supporto The Movie Database

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 :)

2 risposte (nella pagina 1 di 1)

Jump to last post

I sorted it.

Just added "request.Accept = "application/json" to the code.

  Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://api.themoviedb.org/3/search/movie? api_key=****&query=mama")
    request.Accept = "application/json"

Simple really! :)

Yup :) Glad you sorted it out.

Non riesci a trovare un film o una serie Tv? Accedi per crearlo.

Globale

s focalizza la barra di ricerca
p apri menu profilo
esc chiudi una finestra aperta
? apri finestra scorciatoia tastiera

Su tutte le pagine di media

b torna indietro (o al precedente quando applicabile)
e vai alla pagina di modifica

Nelle pagine delle stagioni TV

(freccia destra) vai alla stagione successiva
(freccia sinistra) vai alla stagione precedente

Nelle pagine degli episodi TV

(freccia destra) vai all'episodio successivo
(freccia sinistra) vai all'episodio precedente

Su tutte le pagine di immagini

a apri finestra aggiungi immagine

Su tutte le pagine di modifica

t apri selettore traduzione
ctrl+ s invia modulo

Sulle pagine di discussione

n crea nuova discussione
w segna come visto/non visto
p cambia publico/privato
c cambia chiuso/aperto
a apri attivita
r rispondi alla discussione
l vai all'ultima risposta
ctrl+ enter invia il tuo messaggio
(freccia destra) pagina successiva
(freccia sinistra) pagina precedente

Impostazioni

Vuoi valutare o aggiungere quest'elemento a una lista?

Accedi