DEV Community

Discussion on: Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Collapse
 
tiguchi profile image
Thomas Werner

That error message basically means that the backend's response data is not a valid JSON response. It might be plain text or HTML, and could be something like a server side error message. In order to troubleshoot you need to open the network tab of your browser's developer console and look at the response payload of that failing request when you try to place that request.

I just placed a POST request on that "send" URL using curl as follows:

curl -X POST https://delightart.co/send
Enter fullscreen mode Exit fullscreen mode

The response from the server is an HTML document. So either your backend is not doing the right thing, or your frontend is not using the correct "send" URL

Collapse
 
radgoll profile image
radgoll • Edited

This is the structure of my folders. How to set up endpoint. In this case endpoint is a problem.

dev-to-uploads.s3.amazonaws.com/up...