Giter Club home page Giter Club logo

postmanreview's Introduction

Exercise: Postman Requests

Postman is used to make HTTP requests. In this exercise, you will use Postman to make requests with different endpoints to a web server.

Set up

Clone the server files from the repo accessed through the Download Project button at the bottom of this page.

To set up the server that you will test endpoints on, cd inside the practice's root directory and run npm install. Do not look at the contents of the server folder until you finish this exercise.

To start the server, run npm start. This will allow you to make requests to http://localhost:5000 using any client (i.e., browser or Postman).

To stop the server from listening to requests, press CTRL + c in the terminal where you started the server (i.e., wherever you ran npm start). To restart a stopped server, run npm start again.

Note: If a practice/exercise involves running a server, always make sure to stop the server once you have finished the practice/exercise. Leaving a server running may prevent servers in other practices/exercises from starting properly.

Endpoints

Below is a list of endpoints for this site:

  • GET / - Home Page
  • GET /posts - View all Posts
  • GET /posts/:postId - View details about a specific post
  • POST /posts - Submit the creation of a new post
    • a post has a title field and a description field
  • PUT /posts/:postId/edit - Submit the edit of an existing post
  • DELETE /posts/:postId/delete - Delete a specific post

Formulate requests on Postman

Go through each of the endpoints for this server and formulate requests to the endpoints. Once you start your server, you can make requests in Postman with a root URL path of http://localhost:5000 followed by the endpoint's route. For example, to make a request to GET /posts to view all the posts, the URL path of the request should be http://localhost:5000/posts.

Your goal is to request the following operations on the server using Postman:

  • view all posts
  • view one post
  • create a post
  • edit the post
  • delete the post

Formulate the requests in Postman. Each request should be sent with all the necessary request components. For all requests that require a body, go to the Headers tab and set a Content-Type of application/json. For the body itself, select raw and build your own object ({}) with the desired keys and values.

Analyze the response you get back in Postman after you send the request. You should be able to list the components of the response from the Postman UI.

If you see an error status code in the response, then there was something wrong with the request.

After getting back a successful status code in a response, confirm that the operation you were trying to perform in the request was successful using one or more GET endpoints.

Postman breakdown

postmanreview's People

Contributors

akoven avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.