When I try post data to my server, I'm getting the error:
SyntaxError: Unexpected token O in JSON at position 0 at JSON.parse...
I am not using JSON.parse() so I assume Angulars Http.post() automatically does this?
When I try console.log(JSON.parse(data)), I'm getting:
SyntaxError: Unexpected token o in JSON at position 1...
When I send the data from Postman - works perfectly fine, no errors and the server receives it.
When I send the data in a fetch() api request - also works perfectly fine, no errors whatsoever.
So, this only occurs when I try use angulars HTTP lib and try to post. Below is an example of some JSON data I send and an example of my http post.
Thanks in advance! This has been driving me crazy!
{"tutorialName":"cvbcvbxcvbxcvbbxcv","sections":[]}
this.http.post("http://127.0.0.1:5000/endpoint", JSON.stringify(this.tutorialForm.value)).subscribe();