Streaming Availability

GRATIS CON POSSIBILITร€ DI UPGRADE
Verified
โœ“
Da Movie of the Night | Aggiornamento 8ๆ™‚้–“ๅ‰ | Movies
Popolaritร 

9.9 / 10

Latenza

589ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

Response (Javascript, Jquery) not an object?

Rapid account: Deya Liao
deya.liao
2ๅนดๅ‰

I ran the copied code to generate the API results; in doing so, the response I get is not an objectโ€“โ€“despite it supposedly being one. Thus, there is no way for me to access the keys/values conveniently. Am I doing something wrong?

Rapid account: Deya Liao
deya.liao Commented 2ๅนดๅ‰

Thank you so much! That worked ๐Ÿ˜ƒ

Rapid account: Cevatbarisyilmaz
cevatbarisyilmaz Commented 2ๅนดๅ‰

Add the following line to the settings variable:

"dataType": "json",

This should make the returned response an object.

Rapid account: Deya Liao
deya.liao Commented 2ๅนดๅ‰

The code Iโ€™m using is follows:
const settings = {
โ€œasyncโ€: true,
โ€œcrossDomainโ€: true,
โ€œurlโ€: โ€œhttps://streaming-availability.p.rapidapi.com/search/basic?country=us&service=netflix&type=movie&genre=18&page=1&output_language=en&language=enโ€,
โ€œmethodโ€: โ€œGETโ€,
โ€œheadersโ€: {
โ€œx-rapidapi-hostโ€: โ€œstreaming-availability.p.rapidapi.comโ€,
โ€œx-rapidapi-keyโ€: โ€œโ€
}
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Iโ€™m trying to manipulate the response.

Rapid account: Cevatbarisyilmaz
cevatbarisyilmaz Commented 2ๅนดๅ‰

Can you paste the code you are using here? (Make sure to remove your API key)

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti