Skip to content

CORS error only on GET API calls #2573

@rudvlimadev

Description

@rudvlimadev

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

Good evening everyone,

I'm facing an issue with a GET request to an API in production. My POST calls are okay, but the GET ones are encountering CORS (Cross-Origin Resource Sharing) problems.

The strange thing is that in FlutterFlow it works in 'test' mode and fetches the data correctly, but when I publish it on the web, CORS issues arise.

Has anyone experienced this?

Expected Behavior

I expected the call to bring the JSON correctly in production

Steps to Reproduce

Create a GET API call and publish it to the web. Then try accessing it on a page

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

Access to fetch at 'https://-----------/cadastros/solicitacoes/usuario/1' from origin 'https://costarica.flutterflow.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Context

I expected the call to bring the JSON correctly in production

Visual documentation

image
image
image

Additional Info

No response

Environment

Project ID: costarica-r59g5d

- FlutterFlow version: FlutterFlow v4.1 released March 21, 2024
- Flutter version is 3.19.1
- Browser name and version: Chromer
- SERVER - RailWay
- APLICATION : Python/Django

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions