You can access APIs blocked by CORS restriction by using either Proxyscotch or custom middleware. You can also use the Hoppscotch web extension.
- Enable proxy from "Settings".
- You can replace Proxy URL with your own proxy middleware if you wish.
Since CORS is as simple as adding some HTTP headers, and it’s the only browser blocked. You can build some proxy-like component that will basically make a call for you and get the response from the desired API. You add it to the headers, and then send it back to Hoppscotch.
- Install the browser extension from the below links:
- Click on the Hoppscotch Browser Extension icon from browser toolbar and add a new origin as
http://localhost:8000as per your local server configuration.
- Refresh the Hoppscotch Web App
- Open the interceptor and change the middleware to the browser extension
You can either go to the settings and enable the use of the browser extension as shown below:
Or you can open the interceptor menu and change the middleware as shown below: