Institute of Computer Science
  1. Courses
  2. 2024/25 spring
  3. Enterprise Systems Integration (MTAT.03.229)
ET
Log in

Enterprise Systems Integration 2024/25 spring

  • Home
  • Lectures
  • Practicals
  • Assignements
  • Project and exam
  • Message Board

Session 2.2: Postman - [Pre Lab]

Postman is an API platform that helps developers to design, build, and test their APIs. We will use it to better understand the API architecture, how we can fetch resources, the HTTP request methods/verbs, the HTTP request and responses, and response status codes.

  • Install Postman

Postman interface

We can run the following requests with Postman to test our Rest API project:

1. GET all products

Method: GET
URI: http://localhost:8080/products

2. GET a product by id

Method:  GET
URI: http://localhost:8080/products/{id}

Note: replace {id} with a valid Id (e.g., 01, 02, 03, i.e., http://localhost:8080/products/01)

3. Add a new product

Method: POST
URI: http://localhost:8080/products 

  Headers: 
{
      "Content-type": "application/json"
}

  Body:
  {
    "id": "04",
    "name": "new light vehicle",
    "type": "Light another new",
    "description": "Can also be used for light work",
    "price": 1250
  }

4. Try GET all products again to see the newly added product.

5. Update an existing product

Method:  PUT
URI: http://localhost:8080/products/{id}
Example: http://localhost:8080/products/04

 Headers:
  {
      "Content-type": "application/json"
  }

 Body:
  {
    "id": "04",
    "name": "new light vehicle",
    "type": "Light another new",
    "description": "Updated - Can also be used for light work",
    "price": 1290
  }

6. Try GET all products again to see the updated product.

7. Delete a product

Method:  DELETE	
URI: http://localhost:8080/products/{id}
Example: http://localhost:8080/products/04

8. Try GET all products again to see whether the product was deleted

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment