Testing CORS with POSTman | antony_scott
I've just added CORS support to my Web API and have spend a not inconsiderable amount of time chasing my tail and trying all sorts of different things to try and get it working. Let me explain …
I use the POSTman chrome extension to test my API (outside of unit/integration tests) and whenever I made a request I wasn't getting back the expected Access-Control-Allow-Origin header in the response. So, I loaded up fiddler after scratching my head for a while and I could see the Origin header wasn't being sent in the request. Apparently chrome restricts that header, so it was getting stripped out. I could have used the POSTman python proxy (https://github.com/a85/POSTMan-Chrome-Extension/wiki/Postman-Proxy) but since I already have fiddler I simply customised it a little. I started off by adding a new RulesOption and hard-coding the Origin in fiddler, like so …
Read full article from Testing CORS with POSTman | antony_scott
No comments:
Post a Comment