Request() API ignores headers in Android

Steps to reproduce

request({
    url: "https://example.com/",
    contentType: "application/json"
    headers: {
        // This will be ignored
        header1: "value1"
    },
    body: "{}"
})

request() API:

Expected result

headers will be sent to the target server.

Actual result

No headers other than Content-Type will be sent to the target server.

Environment

  • Operating system: Android
  • Obsidian version: v1.0.4

Additional information

It seems that contentType property replaces whole headers and we can’t set other than Content-Type header.

As a workaround, I used Fetch API:

It seems to work both in Desktop and Mobile.