Guest User

Untitled

a guest
Jul 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. const postURL = `https://sheets.googleapis.com/v4/spreadsheets/1GOSI8dDYmuBIznSV-Ge9WtY_RSivo6rEpnpC8EZDnuw/values/orders!:append?insertDataOption=INSERT_ROWS&valueInputOption=RAW&key=mykey`;
  2.  
  3. let opts = {
  4. method: 'POST',
  5. body: JSON.stringify({
  6. // "range": 'orders',
  7. "majorDimension": 'ROWS',
  8. "values": [
  9. this.state.email
  10. ],
  11. })
  12. }
  13.  
  14.  
  15. e.preventDefault()
  16. fetch(postURL, opts)
  17. .then(response => console.log('Success!', response))
  18. .catch(error => console.error('Error!', error.message))
  19.  
  20.  
  21. }
Add Comment
Please, Sign In to add comment