swsnu / swppspr2015

Repository for discussing common issues that are not project-specific, SNU SWPP Spring 2015
https://sites.google.com/site/snuswppspr2015/
0 stars 0 forks source link

HTTP response & error codes #5

Open jsjason opened 9 years ago

jsjason commented 9 years ago

We received a question regarding the JSON responses of programming assignment 1.

You might think that all HTTP responses must contain HTML of the next page to display. However, it is possible to make the server respond with JSON-formatted data. In fact, we tried this out in the practice session for Rails. As stated in the assignment page, responses from the back-end API must be decodable in JSON format.

You can use AJAX to make your front-end receive this JSON response and create a message box with the alert() function. It doesn't matter how you display the error, because we will grade the front-end manually. You may also use the Rails method respond_to to respond differently depending on which format the requester wants to receive the response.

RaySuhyunLee commented 9 years ago

Thank you for the clarification!