Open KylusheL opened 3 years ago
For JSON resposne, you should include the posted/updated article or comment with it's assigned id.
That is, if the request is to either post or update an article, the JSON response should have id, title, content, author as key and corresponding value as value. If the request is to either post or update a comment, the JSON resposne should have id, id of the article, content, and author as key and corresponding value as value.
Thank you.
Thank you.
I have one more question. In JSON response, corresponding value of the key 'article', 'author' should be its own id? (article's id, author's id)
If the request is related to comment, value for article
key should be id of the article that the comment belongs to, and value for author
key should be id of the author who wrote the comment.
If the request is related to article, value for author
key should be id of the author who wrote the article.
Thanks a lot.
POST /api/article/: Create an article with the information given by request JSON body and response with 201. Posted article (with it's assigned id) should be included in response's content as JSON format.
PUT /api/article/:article_id/: Update the target article with the information given by request JSON body and response with 200. Updated article (with it's id) should be included in response's content as JSON format.
POST /api/article/:article_id/comment/: Create a comment with the information given by request JSON body and response with 201. Posted comment (with it's assigned id) should be included in response's content as JSON format.
PUT /api/comment/:comment_id/: Update the target comment with the information given by request JSON body and response with 200. Updated comment (with it's id) should be included in response's content as JSON format.
about these 4 requests, I'm not sure about how should I make JSON response. Can I get more detail about what should be included in response's content?
Thank you.