Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49229

How to use XMLHttpRequest in ionic

$
0
0

@flycoders_sourav wrote:

Actually I tired to send headers but am not able to do

var data = new FormData();

data.append("email", "flycodersonesignal@gmail.com");

var xhr = new XMLHttpRequest();

xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {

if (this.readyState === 4) {

console.log(this.responseText);

}

});

xhr.open("POST", "http://mydomain.ca/helpify/api/password/create");

xhr.setRequestHeader("Content-Type", "application/json");

xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");

xhr.send(data);

}

Please help me out
thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>