I am bit confused on a task which involves backend web developement: I have to make simple contact us form backend solution 1st task involved form-data post method, but i am not really sure what to do on the 2nd task
Sending JSON data as body element using HTTP POST method
How should i understand this? Is it meant as sending data in json format, through ajax post method?
Full Task instructions
Create a simple “Contact us” form backend solution
Create a backend solution where data can be sent using two different approaches
- form-data POST method using simple HTML form
- Sending JSON data as body element using HTTP POST method
Backend endpoint requirements
- Backend has to retrieve following data a. email i. Email field validation ii. Field is required b. text i. Max 400 symbols ii. Field is required c. first_name i. Max 255 symbols ii. Field is not required d. last_name i. Max 255 symbols ii. Field is not required
- Backend has to respond with error messages in case of incorrect data
- Correct HTTP response status codes has to be used in case of sending data as JSON
- Preferably data has to be stored in database (free choice)
Data has to be sent to following endpoints (URL) a. HTML form - /contact/html i. This has to have a simple HTML web form as well
b. JSON data - /contact/json
Aucun commentaire:
Enregistrer un commentaire