This lesson is designed to be completed offline through self-study.
Please complete the following sections of the Designing RESTful APIs course on Pluralsight:
You will firstly need to establish what framework is used by your company to create RESTful APIs in your programming language. For example, Node Express is used to create APIs in JavaScript and Spring Boot is one of the frameworks used to create APIs in Java.
Next, find a course, either in Pluralsight or elsewhere which explains how to implement a REST API in your chosen framework.
For Java developers you may find section "Using Spring Boot to Create Applications" of the Spring Boot Pluralsight course useful (20 mins).
If you are using Javascript you may find the following sections of the NodeJS Express Pluralsight course useful:
Using Postman, make a GET request to https://http-challenge.multiverse-coaches.io. Follow the instructions you receive from the response and try to complete the challenge.
Implement the following "Messages" APIs in your framework of choice. Note that it is fine to hardcode the responses for now unless you are confident with using a database to retrieve/add data in which case you can modify the request/response bodies as appropriate:
Method | Resource | Request body | Response body | Response status code |
---|---|---|---|---|
GET | /messages | N/A | {"message":"GET all messages response from server"} | 200 |
POST | /messages | {"message":"POST request from client"} | N/A | 201 |
GET | /messages/{id} | N/A | {"message":"GET a single message from server"} | 200 |
PUT | /messages/{id} | {"message":"PUT request from client"} | N/A | 200 |
DELETE | /messages/{id} | N/A | N/A | 200 |
Test the API using Postman
Commit your code to GitHub and notify your coach that this assignment is complete.