Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 30 ยท Sending Requests

Your first request

Send your first GET request in Postman: type the URL, add query params, press Send, then read the status, time, size and the Pretty, Raw and Preview views.

The fastest way to understand Postman is to send a request and read the answer. In this lesson you will make a GET request to a public practice API, add a query parameter, and learn to read everything the response viewer tells you: the status code, the time, the size, the body and its different views.

The steps below are for you to follow in Postman on your own computer, because a web page cannot run the application. Each step is also shown as the same request written in code, using fetch in Node. The code runs here against a small local server that plays the part of the public API (a stand-in), so you can see equivalent output without any network access. Real internet APIs can change, go offline or add rate limits, so treat the example URLs below as practice targets that may behave differently on the day you try them.

The steps in Postman

Send in four steps

Open a tab Click + for a new request.
Method and URL Keep GET and paste the address.
Press Send Or use Ctrl+Enter.
Read the reply Status, time, size and body.
1 / 2
  1. Click + to open a new request tab.

  2. Leave the method on GET.

  3. In the URL bar, type a practice address. Postman publishes a small echo service for exactly this purpose:

    TEXT
    https://postman-echo.com/get?topic=api
    
  4. Click Send.

After a moment, the response appears below the builder. You should see a status such as 200 OK, a time in milliseconds, a size, and a JSON body. The echo service answers by reflecting your request back to you: it lists the query parameters it received (topic with the value api), the headers it saw and the full URL. The exact contents vary, but the idea is simple: you sent something, and the server told you what it got.

Another common practice target is a fake "posts" API. Requesting https://jsonplaceholder.typicode.com/posts/1 returns one post as a JSON object with fields such as userId, id, title and body. Those services exist for learning, so avoid sending anything private to them.

Adding query parameters the easy way

You can type ?topic=api straight into the URL, but there is a nicer way. Open the Params tab under the URL bar. Each row has a key, a value, and a checkbox. Add a row with key lang and value en. Postman updates the URL for you:

TEXT
https://postman-echo.com/get?topic=api&lang=en

The reverse also works: edit the URL by hand and the rows appear in the table. Untick a row to switch the parameter off without deleting it. Send again and look at the args object in the body: it now contains both keys. This is the quickest way to experiment, and Query params, headers and cookies goes deeper.

Reading the response

Status, time and size

Above the response body, three values sit in a row:

  • Status, such as 200 OK. The number is what matters; the words are only a label. You met the families in HTTP and REST in ten minutes.
  • Time, how long the request took from sending to the full response arriving. Hovering over it shows a breakdown of the stages (such as connecting and waiting for the server). Time depends on your network and the server's load, so a single number is a rough hint, not a precise measurement.
  • Size, the number of bytes received. Hovering shows how much was headers and how much was body.

Pretty, Raw and Preview

The Body tab has several views of the same bytes:

  • Pretty formats JSON with indentation and colours, and lets you collapse parts of the structure. It is best for reading.
  • Raw shows the text exactly as received, with no formatting. It is best when you suspect a formatting or whitespace problem.
  • Preview renders the body the way a browser would, which is useful for HTML pages. For JSON it is not very helpful.

Beside the views there is a format selector (JSON, HTML, XML, text) which controls how Pretty is applied. Postman usually guesses it from the Content-Type header. Next to the body, the Headers tab lists the response headers, and Cookies lists any cookies the server set.

To see your request as code, look for the </> (code snippet) icon on the right of the request area. Postman can generate the same call in many languages, including JavaScript fetch, which is a great way to bridge the tool and your own code.

The same request in code

Here is the first request written with fetch. It is read-only because it would call the real internet:

JavaScript
const response = await fetch("https://postman-echo.com/get?topic=api&lang=en");

console.log(response.status, response.statusText);
console.log(response.headers.get("content-type"));
const data = await response.json();
console.log(data.args);

Every line has a Postman counterpart: the URL bar, the status area, the Headers tab and the Body tab.

Try it against a stand-in server

The example below starts a local server that behaves like the echo service (it replies with the query parameters it received). The client then reads the status, the size and the headers, the same values Postman shows in the status bar. It prints whether the response was fast instead of the exact milliseconds, so the output is always the same.

Node.js A GET request and its status-bar numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

The first two requests show how adding a parameter changes the args in the body (and makes the size bigger). The third request asks for a path that does not exist, so you see a 404 Not Found and a JSON error body. In Postman, that would show a red status label, a different size, and the same Body tab.

Pretty versus Raw, shown in code

Pretty, Raw and Preview are three ways of displaying the same response. The stand-in below produces all three views from one response, so you can see what each one does to the text. The "preview" here simply strips the tags to leave the readable text, since a console cannot render a web page.

Node.js Raw, Pretty and a text-only Preview

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Raw is one dense line, Pretty is the same data with indentation, and Preview of the HTML shows only the human-readable result. None of the three changes the bytes the server sent.

Saving the request

When you are happy with a request, press Save (or Ctrl+S). Postman asks for a name and where to put it: choose a collection (create one if needed). Saved requests appear in the sidebar and can be reopened, shared and later run automatically. Unsaved requests still appear in History, but saving gives you a place to keep them organized. Collections are covered in Collections, folders and requests.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. You type https://example.com/items?limit=5 in the URL bar. Where will Postman show limit as a table row?

    Postman parses the query string into rows on the Params tab, and keeps the URL and the table in sync.
  2. 2. Which Body view is best when you suspect stray whitespace in a response?

    Raw shows the response exactly as received. Pretty reformats it and can hide such details.
  3. 3. A request to a path that does not exist returns 404. What does this tell you about the request?

    404 Not Found means the server could not find a resource at that URL. Check the path for typos.
  4. 4. Why is the Time value a rough hint rather than an exact measurement?

    Each send can take a different time because of network conditions and server load, so one reading says little. Repeated measurements are more useful.

Summary

  • A first request needs only a method, a URL and a click on Send.
  • The Params tab edits the query string as a table, and stays in sync with the URL.
  • Read the status, time and size above the response; hover for more detail.
  • Pretty, Raw and Preview are different displays of the same body.
  • The Headers and Cookies tabs show what else came back.
  • Save a request into a collection to keep it organized.
  • Public practice APIs can change at any time; the runnable examples here use a local stand-in server instead.

Next: Methods and request bodies.