title: Disable CORS on Flutter
body: <p>even though there are a few post/questions on CORS issues with Flutter I'm still unable to fix it with the solutions available, which mostly involving fixing it on the server-side. In my case, I don't have access to the server/API. Additionally, it's has been very hard to ask the third party to change their services, since while testing with other frameworks/languages such as Python and VBA there were no issues getting data from the API as well as with INSOMNIA testing.</p>
  <p>So, my thinking is that for some reason flutter is triggering CORS, is there to &quot;disable&quot; it, on the request?</p>
  <p>The error I'm getting is:</p>
  <blockquote>
  <p>Access to XMLHttpRequest at 'https://yyy.ytr.com.xx/xxx/xxx/xx/zzzzz'
  from origin 'http://localhost:56659' has been blocked by CORS policy:
  Response to preflight request doesn't pass access control check: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource.</p>
  </blockquote>
  <p>If I disable CORS locally it works, but obviously, it fails when deployed.</p>
  <p>Here's how I'm currently doing my request in Flutter.</p>
  <pre><code> else {
    final response = await http.post(Uri.parse(API),
        body: json.encode({
          &quot;key&quot;: Key,
          &quot;user&quot;: User,
          &quot;pass&quot;: Pass,
        }),
        headers: &lt;String, String&gt;{'Content-type': 'application/json'});
  </code></pre>
  <p>Thanks,</p>