Skip to content

Instantly share code, notes, and snippets.

@melvincarvalho
Created October 28, 2012 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melvincarvalho/3968713 to your computer and use it in GitHub Desktop.
Save melvincarvalho/3968713 to your computer and use it in GitHub Desktop.
file ops
function deleteFile(file) {
var body = '';
xhr = new XMLHttpRequest();
xhr.open('DELETE', file, false);
xhr.setRequestHeader('Content-Type', 'text/turtle; charset=UTF-8');
xhr.send(body);
}
function putFile(file, data) {
xhr = new XMLHttpRequest();
xhr.open('PUT', file, false);
xhr.setRequestHeader('Content-Type', 'text/turtle; charset=UTF-8');
xhr.send(data);
}
function postFile(file, data) {
xhr = new XMLHttpRequest();
xhr.open('POST', file, false);
xhr.setRequestHeader('Content-Type', 'text/turtle; charset=UTF-8');
xhr.send(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment