Soporte de The Movie Database

Hi!

I am really looking forward to use your api in our school project, the thing is that i have stuck.. :(

I just trying to connect to your db and fecth a move as a test.. but it say my key is invalid. I know it´s valid so i must have done something wrong.. and i would like a example from this code that would work.. :D

private async void KopplaDB() { var baseAddress = new Uri("https://api.themoviedb.org/3/"); var key = "api_key=2b95*****************************"; using (var httpClient = new HttpClient { BaseAddress = baseAddress }) {

            httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json");

            using (var response = await httpClient.GetAsync("movie/{frozen}" + key))
            {

                string responseData = await response.Content.ReadAsStringAsync();
            }
        }
    }

Where am i doing the wrong thing?

Thanks in advance!

/T

2 respuestas (en la página 1 de 1)

Jump to last post

I fixed it :) this works: private async void KopplaDB() { var baseAddress = new Uri("https://api.themoviedb.org/3/"); var key = "?api_key=2b95************************************"; using (var httpClient = new HttpClient { BaseAddress = baseAddress }) {

            httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json");

            using (var response = await httpClient.GetAsync("movie/550" + key))
            {

                string responseData = await response.Content.ReadAsStringAsync();
            }
        }
    }

But i would like an example of how to fill a list or something else with the info i a C# Windows Universal App just to get started.. :)

Thanks!

/T

Hi tomas993,

Have you taken a look at some of the C# libraries? They could be very useful to help you get started. These two look actively maintained:

Hope that helps.

¿No encuentras una película o serie? Inicia sesión para crearla:

Global

s centrar la barra de búsqueda
p abrir menú de perfil
esc cierra una ventana abierta
? abrir la ventana de atajos del teclado

En las páginas multimedia

b retrocede (o a padre cuando sea aplicable)
e ir a la página de edición

En las páginas de temporada de televisión

(flecha derecha) ir a la temporada siguiente
(flecha izquierda) ir a la temporada anterior

En las páginas de episodio de televisión

(flecha derecha) ir al episodio siguiente
(flecha izquierda) ir al episodio anterior

En todas las páginas de imágenes

a abrir la ventana de añadir imagen

En todas las páginas de edición

t abrir la sección de traducción
ctrl+ s enviar formulario

En las páginas de debate

n crear nuevo debate
w cambiar el estado de visualización
p cambiar público/privado
c cambiar cerrar/abrir
a abrir actividad
r responder al debate
l ir a la última respuesta
ctrl+ enter enviar tu mensaje
(flecha derecha) página siguiente
(flecha izquierda) página anterior

Configuraciones

¿Quieres puntuar o añadir este elemento a una lista?

Iniciar sesión