Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created June 20, 2019 05:06
Show Gist options
  • Select an option

  • Save wfng92/5ab9f0dbd3d5df615f9fef31c6508914 to your computer and use it in GitHub Desktop.

Select an option

Save wfng92/5ab9f0dbd3d5df615f9fef31c6508914 to your computer and use it in GitHub Desktop.
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//custom action to process this.responseText
}
};
xhttp.open("POST", "http://localhost:5005/model/parse");
xhttp.setRequestHeader("Content-Type", "application/json");
//replace Hello with input message
xhttp.send(JSON.stringify({text:'Hello'}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment