0% found this document useful (0 votes)
5 views3 pages

Lab 7spring REST

The document outlines a lab for building a RESTful web service using Spring Boot, focusing on developing a simple product catalog API. Key learning objectives include using RESTful HTTP methods and testing APIs with tools like Postman. The lab requires creating specific endpoints for managing products and submitting the project with testing evidence.

Uploaded by

nirvairsingh2005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Lab 7spring REST

The document outlines a lab for building a RESTful web service using Spring Boot, focusing on developing a simple product catalog API. Key learning objectives include using RESTful HTTP methods and testing APIs with tools like Postman. The lab requires creating specific endpoints for managing products and submitting the project with testing evidence.

Uploaded by

nirvairsingh2005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Spring REST Lab

Lab Title:
Building a RESTful Web Service using Spring Boot

Topic:
Spring Boot RESTful API

Learning Objectives:
● - Develop a basic RESTful API using Spring Boot.

● - Understand and use RESTful HTTP methods (GET, POST, PUT, DELETE).

● - Work with data using in-memory or file-based data structures.

● - Test REST APIs using Postman or any REST client.

Lab Tasks:
Use Case: Simple Product Catalog REST API

You will build a Spring Boot application that manages a product catalog. Each product has:

● - id: Integer

● - name: String

● - price: Double

● - category: String

Required Endpoints:

● - GET /products – Returns a list of all products.

● - GET /products/{id} – Returns a specific product by ID.

● - POST /products – Adds a new product. Accepts JSON in the request body.

● - PUT /products/{id} – Updates an existing product.


● - DELETE /products/{id} – Deletes the product with the specified ID.

Folder/File Structure:

spring-rest-lab/
├── src/
│ └── main/java/com/example/product/
│ ├── [Link]
│ ├── [Link]
│ └── [Link]
└── [Link]

Testing Instructions:
Use Postman, cURL, or a REST client to test each endpoint.

Example POST JSON:

{
"name": "Laptop",
"price": 799.99,
"category": "Electronics"
}

Submission Requirements:
● Submit a .zip file of the complete Spring Boot project.

● Include:

● - Screenshot of each API tested in Postman or REST client.

Grading Rubric (4%):


Criteria Marks

All endpoints implemented correctly 1.5

Correct data model and logic 0.5

Proper HTTP methods used 0.5


Working example/test screenshots 1.0

Code quality & folder structure 0.5

Total 4.0

You might also like