Skip to content

Instantly share code, notes, and snippets.

@shierro
Created August 11, 2018 16:31
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 shierro/461b75efd3f437324c7e659fa876a07d to your computer and use it in GitHub Desktop.
Save shierro/461b75efd3f437324c7e659fa876a07d to your computer and use it in GitHub Desktop.
onSaveClicked = () => {
const options = {
crossDomain: true,
credentials: 'include',
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: {
filename: this.state.name
}
};
fetch('http://localhost:3000/api/manage/privacy', options)
.then(res => {
const jsonResp = res.json();
console.log(jsonResp);
this.setState({ files: jsonResp.result });
})
.catch(console.error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment