Intro to Backend Development
  • Introduction
  • SP25 Syllabus
  • Apply to Take the Course
  • Getting Started
  • Weekly Feedback Form
  • Ed Discussion
  • Intro to Backend SP25 Google Calendar
  • Cheat Sheets
    • Assignment Requirements
    • Assignment FAQs
    • Error FAQs 😢
    • Concept FAQs
    • Postman
    • Command Line
    • Virtual Environment
  • Chapters
    • 1. Routes
      • Pre-Class TODO's
      • Lecture
      • Assignment Handout
      • API Specification
    • 2. Databases
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 3. Relational Databases
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 4. Abstractions
      • Pre-Class TODO's
      • Lecture
      • Demo
      • Assignment Handout
      • API Specification
    • 5. Containerization
      • Pre-Class TODO's
      • Docker Installation
      • Lecture
      • Demo
      • Assignment Handout
    • 6. Deployment
      • Lecture
      • Demo
      • Assignment Handout
    • 7. Images
      • Demo
      • Assignment Handout
    • 8. Authentication
      • Lecture
      • Demo
      • Assignment Handout
    • (Work in Progress) OAuth
      • Pre-Class TODO's
      • Lecture
      • Demo
      • OAuth 2.0 vs OpenID
      • Flask / OpenID example
  • Additional Topics
    • Git and Github
    • HackOurCampus
  • Other AppDev Courses
    • Intro to iOS Development
    • Intro to Android Development
    • Intro to Digital Product Design
  • Deprecated
    • Previous Semester Syllabi
      • FA22 Syllabus
      • SP22 Syllabus
      • FA21 Syllabus
      • SP21 Syllabus
      • FA20 Syllabus
      • SP20 Syllabus
    • Deployment Pre-Class TODO's
    • PA6 Assignment Handout
    • Deployment Demo
    • Final Project (Spring 2019)
      • Final Project Award Winners
Powered by GitBook
On this page
  • Download Postman
  • Why use Postman
  • How to "hit" an endpoint in general
  • How to make a GET request in Postman
  • GET Query Parameters
  • How to make a POST request in Postman

Was this helpful?

  1. Cheat Sheets

Postman

Contributors: Alanna Zhou

PreviousConcept FAQsNextCommand Line

Last updated 1 year ago

Was this helpful?

Download Postman

Highly recommend you install Postman as soon as the course starts! It will be crucial to assignments and practically any backend dev-ing.

Why use Postman

If you hit an endpoint in your browser, the best you can do is hit endpoints that are just GET requests (see the section below on how to hit an endpoint). There's no easy way for you to test parts of your backend API that handle POST and DELETE requests -- so how do you know if you are responding in the way that you coded and expected? Use Postman!

Postman lets you do all of these things with a super helpful user interface. You can even organize all of the endpoints your testing into folders and workspaces, as well as share them with whoever is collaborating with you on a project!

How to "hit" an endpoint in general

When you run your code locally (aka on local host), your endpoint at port 5000 can be reachable at all of these options:

Common mistake #1

If you can't hit your endpoint, ensure that you are also hitting the right port that your code is running on! This is usually declared somewhere at the bottom of your app.py:

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)

Common mistake #2

There's a difference between http and https, so make sure you are hitting http!

How to make a GET request in Postman

  1. Select GET from the dropdown to the left of the Enter request URL input text field bar

  2. Input the endpoint receiving the GET request into the text field bar

  3. Click the blue send button

  4. Postman will now show you either your successful JSON response at the bottom, or some errors for you to fix

GET Query Parameters

GET requests can also have parameters, and there are two ways to hit an endpoint with parameters:

1. Type in your GET parameters manually into the input text field bar

where key1 and key2 are the names of your parameters, and value1 and value2 are the corresponding values (you can have as many as you want, but this example only has two key-value pairs).

For example, if I'm designing backend that returns some information about a student given their first name, last name, and age, I could type this URL into the text field input bar:

2. Input your GET parameters into the table and let Postman automatically fill in your URL

Just type away under Params (select this option in the banner under the URL) and the checkboxes will automatically be checked and your URL will automatically have the params filled in!

How to make a POST request in Postman

  1. Select POST from the dropdown to the left of the Enter request URL input text field bar

  2. Input the endpoint receiving the POST request into the text field bar

  3. Click on Body in the banner right below (next to Headers and Pre-request Script)

  4. Select raw

  5. Select JSON from the dropdown to the right of raw

  6. Type in your POST request body in JSON format

  7. Click the blue send button

  8. Postman will now show you either your successful JSON response at the bottom, or some errors for you to fix

Here's an example of what a POST request could look like, with the { "first" ... "true" } information being the POST request body written in JSON format.

Note that JSON can take in strings, integers, and booleans.

This is because 0.0.0.0, 127.0.0.1, and localhost all mean you're running off of local host! You can read more about the differences on .

this stack exchange post
Download Postman | Get Started for FreePostman
http://0.0.0.0:5000/0.0.0.0
http://127.0.0.1:5000/127.0.0.1
http://localhost:5000/localhost
http://localhost:5000/?key1=value1&key2=value2localhost
http://localhost:5000/?first=john&last=doe&age=20localhost
Logo