Skip to main content

"Access-Control-Allow-Origin" = "*" using POST to add new records

  • Jun 20, 2022 5:55 AM UTC
  • 5 replies
  • 118 views

Forum|alt.badge.img+6

So I have a custom app I am using, written in swift. I am trying to add records to one of my tables. But after doing some debugging I found I was getting the error: “Access-Control-Allow-Origin” = “*”. I did some research and found out it was a CORS error. And some light research and I am not sure really how to go about fixing this.

This topic has been closed for replies.

5 replies

Alexey_Gusev
Forum|alt.badge.img+25

hi,

using remotefetch instead of fetch helped me


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Jun 21, 2022 5:01 AM UTC

What platform are you using to create your custom app?
Are you using the REST API to access Airtable?

Custom apps written using the custom apps/blocks sdk are written in JavaScript/React, and scripts within Airtable are written in JavaScript, so it sounds like you are using a different platform.


Forum|alt.badge.img+6
  • Author
  • Participating Frequently
  • Jun 22, 2022 12:38 PM UTC

What platform are you using to create your custom app?
Are you using the REST API to access Airtable?

Custom apps written using the custom apps/blocks sdk are written in JavaScript/React, and scripts within Airtable are written in JavaScript, so it sounds like you are using a different platform.


I am using Xcode to write the app in Swift. I am using the REST API to access Airtable. I never had this issue till just recently.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Jun 22, 2022 2:32 PM UTC

I am using Xcode to write the app in Swift. I am using the REST API to access Airtable. I never had this issue till just recently.


New issues rarely crop up without some sort of change. Has anything changed in your code or platform? Are you running the code in the same environment? What errors are you seeing?

Since you are using the REST API, I am surprised that it would be a CORS issue.


Forum|alt.badge.img+6
  • Author
  • Participating Frequently
  • Jun 22, 2022 3:26 PM UTC

New issues rarely crop up without some sort of change. Has anything changed in your code or platform? Are you running the code in the same environment? What errors are you seeing?

Since you are using the REST API, I am surprised that it would be a CORS issue.


I was running the script on a different computer. But then I ran my script on the normal computer I still get that issue. When I run the code from the app it doesn’t work. The only thing that doesn’t work is adding records to the Database. It pulls and updates records. But it won’t add records. I am assuming its a CORS issue. The title is all the response I get back says.