The Movie Database Support

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 erantzun (1(e)tik 1. orrian)

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.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Ezarpenak

Elementu hau kalifikatu edo zerrenda batera gehitzea nahi al duzu?

Saioa hasi