본문 바로가기

express

Postman

How to set Query Parameters

first is appending the query string to the end of the URL.

second is Clicking the Params button to the left of the URL field, which will presents additional text fields under URL field to enter query parameters in key-value pais.

Use a query parameter to filter articles on Conduit by tag.

request method is 'GET' and the request URL is 'https://conduit.productionready.io/api/articles'

Press the param button to the left of teh URL field, and enter in tag as the key and dragons as the value. ?tag='dragons' should then get appended to the request URL.

and Press 'Send' then you get response an array of articles, each with dragons included in the list of tags.

Let's go over how to make POST requests with a body payload.

When you login you change the request method to POST, and put 'https://conduit.productionready.io/api/users/login' in url. and also put your email and password in the body like "user":{"email": "hello@example.com", "password":"examplepassword"})

Adding an Authorization header to request.

Go to the Headers tab below the request URL and add a new header with Authorization as the key and Token jwt.token.here as the value, replacing jwt.toekn.here with a token from previous login request.

 

'express' 카테고리의 다른 글

routing _express docs  (0) 2020.05.01
mongoose  (0) 2020.05.01
execPopulate() /mongoose.  (0) 2020.04.29
payload  (0) 2020.04.29
Prifiles for Users /node  (0) 2020.04.28