Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <system.webServer>
- <httpProtocol>
- <customHeaders>
- <add name="Access-Control-Allow-Origin" value="*"/>
- <add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
- <add name="Access-Control-Allow-Headers" value="Content-Type"/>
- </customHeaders>
- </httpProtocol>
- </system.webServer>
- var data = null;
- var xhr = new XMLHttpRequest();
- xhr.withCredentials = false;
- xhr.addEventListener("readystatechange", function () {
- if (this.readyState === 4) {
- console.log(this.responseText);
- }
- });
- xhr.open("POST","ur here");
- xhr.setRequestHeader("Content-Type", "application/json");
- xhr.setRequestHeader("Cache-Control", "no-cache");
- xhr.setRequestHeader("Authorization", "Basic " + btoa("demo:demo"));
- xhr.send(data);
Add Comment
Please, Sign In to add comment