lime360 / hastebin-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hastebin-api

this is just supposed to be a demo on post requests (pushing data to servers) it uses axios, but the idea is pretty much the same.

// axios version - node-fetch

axios.post("...",data)

//If you want to do something with the response
.then(response => {
...
})
.catch(error => console.log(error));
// XML (web) Request Version or it might be deprecated. ¯\_(ツ)_/¯

var request = XMLHttpRequest();
request.addEventListener(...);
request.open("POST", "...");
request.send(...);

Executing

Assuming you have node.js installed:

$ node test.js

About


Languages

Language:JavaScript 100.0%