Skip to content

Instantly share code, notes, and snippets.

@nxvhm
Created June 9, 2020 11:16
Show Gist options
  • Save nxvhm/e5923c5c4dba0fa67b91322dd2fdbeaf to your computer and use it in GitHub Desktop.
Save nxvhm/e5923c5c4dba0fa67b91322dd2fdbeaf to your computer and use it in GitHub Desktop.

Revisions

  1. nxvhm created this gist Jun 9, 2020.
    12 changes: 12 additions & 0 deletions browserConsole.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    fetch('http://mydomain.local/api/photo', {
    method: 'POST',
    mode: 'cors',
    headers: {
    'Content-Type': 'application/json'
    },
    body: JSON.stringify({'lat': 12121, lng: 1212121, title: 'dasdasdsa', 'image': 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=='})
    }).then(res => {
    console.log('res', res);
    }).catch(err => {
    console.log('err', err);
    })