Rejected promise with error

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

Rejected promise with error

Postby PaulIngram » 04 Jun 2019, 16:11

Ricoh Theta SC
FIRMWARE: Version 01.20
API: v2.1
Request type: POST
Headers: “Content-type”: “application/json; charset=UTF-8"
Data: “{\“name\“:\“camera.getLivePreview\“,\“parameters\“:{}}”

When POSTing to this command, we receive the following headers as expected:

```multipart/x-mixed-replace; boundary=---osclivepreview---```

However, when we use the following JavaScript code to read the stream (for the mixed-replace content parts) we simply get a rejected Promise with the error

Code: Select all
```"TypeError: cancelled"```
```fetch('', {
                method: 'POST',
                headers: {
                  "Content-type": "application/json; charset=UTF-8"
                body: JSON.stringify({ name: 'camera.getLivePreview', parameters: {}}),
            .then(function (res) {
                return res.body.getReader().read().then(function processStream(readData) {
                    return res.body.getReader().read().then(processStream);

...any help would be appreciated - thanks!
Posts: 1
Joined: 27 Oct 2017, 09:18

Return to Development

All times are UTC