Tag: javascript
Bypass CORS Errors When Testing APIs Locally
Anyone who has worked with a RESTful API using JavaScript knows that testing can be a complete pain if the API owner hasn’t enabled CORS on their server. So what is CORS? According to Wikipedia, it is the following:
Cross-origin resource sharing (CORS) is a mechanism that allows many resources (e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain the resource originated from.
Often API owners will leave CORS disabled even though their API is open to the public. In my opinion it doesn’t feel public if the API owner is not allowing requests from all angles.
Here are a few tricks I’ve picked up in regards to bypassing the awful CORS errors you receive in your browser when testing.
Read MoreSearch
Recent Posts
- Test Password Strength and Password History with TypeScript and MongoDB
- Extract Text from Your PDF and Image Files with Apache Tika
- How to Install MongoDB on Ubuntu: A Step-by-Step Guide for Beginners
- Running MongoDB in Docker - A Complete Guide with Examples
- How to Design Nested Documents for a Blogging App