XMLHttpRequest cannot load <url> due to access control checks

Hello,

I'm trying to make a http request to local network and I received the following error:
Code Block
Preflight response is not successful
XMLHttpRequest cannot load <url> due to access control checks.
Failed to load resource: Preflight response is not successful

My request:
Code Block
   axios
    .get('<url>')
    .then(res => {
     console.log(res)
    }).catch((err) => {
     if (err.status === 500) {
      // error
     } else {
      // error
     }
    })

I tried to set some headers to this request like Access-Control-Allow-Origin, Access-Control-Allow-Headers, Access-Control-Allow-Methods. Unfortunately it didn’t work.

This issue is only in iOS app. In android app or browsers the request works properly.

Can anyone help me? Thanks!
Is there any additional information in the console log from Web Inspector? (You may connect to an app or Safari on an iOS/iPadOS device using Web Inspector from Safari on macOS.)

Note that to inspect a third-party (your) app, you need to build and run from Xcode. Safari Web Inspector will not connect to Production builds of third-party apps.

XMLHttpRequest cannot load &lt;url&gt; due to access control checks
 
 
Q