Hi, I'm trying to get json data. I use BlackBerry 10 platform (qml, cascade). I try this:
function sendRequest() {
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log(xhr.responseText)
}
}
}
xhr.open("GET", "https://api.themoviedb.org/3/search/movie?api_key=<YOUR-API-KEY>&language=cs-CZ&query=Hulk&page=1&include_adult=false")
xhr.send()
}
Why does it not work? Everything worked for me last week!
The code is correct. When I try another API, everything works.
for example this one:
xhr.open("GET", "http://www.allten.cz/wp-json/wp/v2/posts/1019", true)
or this one:
xhr.open("GET", "https://www.cnb.cz/cs/financni_trhy/devizovy_trh/kurzy_devizoveho_trhu/denni_kurz.txt", true)
Thank you very much for the answer.
Bir filmi veya diziyi bulamıyor musun? Eklemek için oturum aç.
Bu öğeyi derecelendirmek veya bir listeye eklemek ister misiniz?
Üye değil misin?
Yanıtla Travis Bell
a 23, 2019 tarihinde saat 10:36 ÖS'da
We were having a few availability issues around this time, is everything working now?
Yanıtla Wajsar Josef
a 24, 2019 tarihinde saat 4:13 ÖÖ'da
Unfortunately not.
Yanıtla Travis Bell
a 24, 2019 tarihinde saat 11:34 ÖÖ'da
You'll need to provide some more verbose logs as to what is actually failing. You can see here, that query is working fine:
Yanıtla Wajsar Josef
a 24, 2019 tarihinde saat 11:37 ÖÖ'da
I don't know what fails. I used the same code last week and everything was fine.
I also have the code okay - if I use a different url address, everything works fine.
Yanıtla Wajsar Josef
a 24, 2019 tarihinde saat 11:39 ÖÖ'da
When I try url address in PC, everything works fine but no content is loaded in mobile application.
Yanıtla Travis Bell
a 24, 2019 tarihinde saat 11:40 ÖÖ'da
You could try switching to http, instead of https to see if it makes a difference. I'm just guessing in the dark here though. You'll need to try an enable some verbose HTTP logging and I'm sure you'll see an error somewhere.
Yanıtla Wajsar Josef
a 24, 2019 tarihinde saat 11:54 ÖÖ'da
Super ... You are amazing
I tried http instead of https and everything already works.
But why did https work last week?
Is there a problem if I use http instead of https?
Thank you very much again for your help.
Yanıtla Travis Bell
a 24, 2019 tarihinde saat 11:57 ÖÖ'da
It could be a TLS issue. We are enforcing TLS 1.1 as a minimum, and depending how old your platform is, it might be trying to use TLS 1.0. You'll need to read the docs about your HTTP library and see if TLS > 1.1 is supported and how you can make sure to use it if it is.
Yanıtla Wajsar Josef
a 24, 2019 tarihinde saat 11:58 ÖÖ'da
OK Thank you very much for your help. I appreciate it.