Here is a check list 👇
Here is a check list 👇
1️⃣ CORS headers
Access Control Allow Origin
Access Control Allow Methods
Access Control Allow Headers
Access Control Allow Credentials
Postman does not care about CORS
Browser does
If it works in Postman but not in browser 90 percent chance it is CORS
2️⃣ Authorization header
Is Bearer token actually going from frontend
Is cookie being sent
Did I enable withCredentials
Did backend allow credentials
3️⃣ Content Type
Frontend might accidentally send text plain instead of application json and body parser just ignores it
4️⃣ Cookies
SameSite
Secure
HttpOnly
SameSite strict or lax can silently block your request and you keep debugging for 2 hours
5️⃣ DevTools Network tab
Compare request headers
Compare response headers
Read the console error properly
Comment "API" to get complete list of API debugging methods
Like, Share and Follow for more !!
And save this reel for later :)
#api #backend #systemdesign #tech #web development
Comments
Comments from the original post on Instagram
No comments yet
