Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. fetch(nodeObj.RemoteUrl, {
  2. method: "post",
  3. credentials: "include",
  4. headers: {
  5. "RequestVerificationToken": document.querySelector("input[name='__RequestVerificationToken']").value,
  6. "Content-Type": "application/json"
  7. },
  8. body: JSON.stringify(data)
  9. })
  10. .then(function (response) {
  11. if (response.status !== 200) {
  12. console.log('Fetch ERROR: ' + response.status);
  13. }
  14. response.json().then(function (data) {
  15. console.log('Fetch GOOD');
  16. console.log(data);
  17. });
  18. })
  19. .catch(function (err) {
  20. console.log(`Error: ${err}`);
  21. });
  22.  
  23. SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement