תמיכת 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 תגובות (בדף 1 מתוך 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.

.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם

עולמי

s התמקד בשורת החיפוש
p פתח תפריט פרופיל
esc סגור חלון פתוח
? פתח חלון קיצורי דרך של מקלדת

בדפי מדיה

b לך חזרה (או אל הורה אם ישים)
e לך אל דף עריכה

בדפי עונות

(חץ ימני) לך אל העונה הבאה
(חץ שמאלי) לך אל העונה הקודמת

בדפי סדרות

(חץ ימני) לך אל הפרק הבא
(חץ שמאלי) לך אל הפרק הקודם

בכל דפי תמונה

a פתח חלון הוספת תמונה

בכל דפי עריכה

t פתח בוחר תרגום
ctrl+ s הגש טופס

בדפי דיון

n צור דיון חדש
w עורר מעמד צפייה
p עורר ציבורי/פרטי
c עורר סגירה/פתיחה
a פתח פעילות
r השב אל דיון
l לך אל תשובה אחרונה
ctrl+ enter הגש את הודעתך
(חץ ימני) הדף הבא
(חץ שמאלי) הדף הקודם

הגדרות

?רוצה לדרג או להוסיף פריט אל רשימה

היכנס