Search code examples
asp.net-web-apiarduinocross-domainfiddler

Cross domain http request from arduino


I am working with a project in which I have to send data from arduino using http post request to my web rest api. I know web browsers do not allow cross domain requests. So here do I have to take care of same origin policy or not? If yes then while testing my api I use fiddler , so is not it cross domain?


Solution

  • If the client making the request isn’t running in a browser, the same-origin policy doesn’t apply.

    The “origin” concept and the notion of same-origin are in practice really only relevant to web apps running in browsers. Browsers are the only runtimes that enforce the same-origin policy. Runtimes other than browsers can all freely make cross-origin requests without restrictions.

    So unless the client code you’re sending data from on the Arduino is running in a browser, you don’t need to worry about any cross-origin restrictions prevent you from doing anything.