POST & PUT Requests

Post & Put Requests

Objectives

  1. Learn how to make a POST and PUT requests using Postman
  2. Learn how to use Postman’s Pre-request Script
  3. Learn how to use Environment variables (for different kinds of development environment e.g test, production, staging, etc.)

Instruction

  1. Using jsonplaceholder, create a new post with title “Foo” and body “Bar”. User id is 1
  2. Create a new environment and name it as jsonplaceholder
  3. Using the pre-request script, create an environment variable called postBody with a value of “Foo” and a random number. Example: Foo 4136. The environment we are going to use for this variable is the jsonplaceholder environment

Now create a new post using the jsonplaceholder environment and the postbody variable.