Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,161,448 members, 7,846,865 topics. Date: Saturday, 01 June 2024 at 04:42 AM |
Nairaland Forum / Science/Technology / Programming / Backend Devs Please Help Me With A Cors Error (640 Views)
Pro JS Devs, Please Is This Variable Chaining / So There Are Devs That Earn Up To 30k USD. / Backend Devs How Do You Advertise Your Skills? (2) (3) (4)
Backend Devs Please Help Me With A Cors Error by Tobedated(m): 5:08am On Dec 18, 2022 |
I'm trying to make a post request to a server but I keep getting this error Content-Type is not allowed by Access-Control-Allow-Headers I've tried adding content-type and access-control-allow-origin to the Access-Control-Allow-Headers at the backend but it still brings up the same error Searched on Google and I couldn't find a working solution Please do you know the solution |
Re: Backend Devs Please Help Me With A Cors Error by Codepain: 5:56am On Dec 18, 2022 |
Let's see your code. It's a common error it should be easy to solve |
Re: Backend Devs Please Help Me With A Cors Error by Tobedated(m): 8:48am On Dec 18, 2022 |
Codepain:
|
Re: Backend Devs Please Help Me With A Cors Error by thug: 9:11am On Dec 18, 2022 |
install cors and use it as a middleware |
Re: Backend Devs Please Help Me With A Cors Error by QuoteJustOnce: 12:34pm On Dec 19, 2022 |
app.use(cors()) will help you, use all you want during your development... but unsafe for production for production, something more like below is sufficient. https://i.imgur.com/2mJG5Uw.png Then pass the delegate to it, like so app.use(cors(corsOptionsDelegate)) |
Re: Backend Devs Please Help Me With A Cors Error by Sleekcode: 10:14pm On Dec 19, 2022 |
QuoteJustOnce: You forget to tell him at the top of his code before making any request |
(1) (Reply)
Maui Controls Guides For Beginner C# / Windows Bus / Can I Know/learn Programming?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |