I am calling the following method (in the browser)...
# javascript
I am calling the following method (in the browser)
Copy code
fun test() {
      RequestInit(method = "GET",
                  headers = js("{'Accept': 'application/octet-stream'}"),
                  mode = RequestMode.NO_CORS))
      .then { response ->
        println("response status = ${response.status}")
      .then { blob -> println("blob size = ${blob.size}") }
      .catch { println(it) }
and getting this output:
Copy code
response status = 0
blob size = 0
After looking at the generated javascript code it looks fine. The browser downloads the file fine (the Network dev tool tab shows the request properly going through and getting response back) but I am not getting it. A status code of 0 is also very weird... Any help appreciated Thanks