Open 41w opened 5 years ago
Hi, @egillespie When I try to perform any actions (get, post, put, delete) inside postman, it always gives me this error SyntaxError: Unexpected token t in JSON at position 4
, can you help me solve this error? The code was working correctly at first when I tried to 'get', but suddenly it only gives this error. Thank you!
Happy to help. 🙂 Do you mind sharing a screenshot of Postman that shows the error and the body of the JSON you are sending to your API?
Hi, @egillespie This is the screenshot of error shows in the Postman. and all my files have been pushed to the Github repository. Thank you so much for your help!
Hmm, I think the issue may be the data you are sending to your API in the server. Do you mind sharing a full screenshot of Postman that includes the Body tab like in the example below?
The message suggests that the fourth character of the Body contains the letter t
and I'm wondering if it's because you don't have quotes ("
) around the keys and values in your JSON.
For example, this is invalid JSON:
{
text: 'Vacuum driveway',
status: 'Not done'
}
This, however, is valid JSON:
{
"text": "Vacuum driveway",
"status": "Not done"
}
Hi, Erik @egillespie Thank you so much for this semester, I really enjoy the class and I think I have learned a lot from this course. You are always very kind, patient and being so helpful. Really appreciated!
Thank you so much, @41w, hearing that really makes my day! 😊
Your code looks great and I'm able to do all of the different operations using Postman. Really nice work on this project. I appreciate your enthusiasm and continued effort on these projects! 👏 :shipit:
Update your todo list API to use a relational database
@egillespie Can you take a look at this? It's hosted here and meets the following criteria:
pg
client is used to create a connection pool and access the databasetodo
table is saved in the projecttodo
table in the databaseHi Erik, as I mentioned before, I uploaded an empty file in order not to miss the deadline for uploading new projects. I will keep working on these and finish them before May 3rd. Thank you!