Postman에서 일괄 요청 실행
Postman에서 일괄 요청하기
시연하려면 몇 가지 설정이 필요하므로 하나 만들어 보겠습니다.
1. 설정
데이터 생성 및 반환을 위한 2개의 엔드포인트가 있는 간단한 익스프레스 서버를 만들었습니다. 변수에 데이터를 저장하고 포트 3000에서 서버를 실행합니다.
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const port = 3000;
// parse request data
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
let data = [];
app.get("/", (req, res) => res.json(data).status(200));
app.post("/", (req, res) => {
data = [...data, req.body];
res.json(req.body).status(201);
});
app.listen(port, () => console.log(`App listening on port ${port}`));
이제 우편 배달부로 이동하여 컬렉션을 생성해 보겠습니다(Data Endpoints라고 함).

이제 컬렉션에서 2개의 요청을 생성해 보겠습니다(익스프레스 서버의 2개 엔드포인트용).

이 데이터를 삽입할 것입니다. 파일(seedData.json)에 저장하자.
[
{
"id": 1,
"first_name": "Gary",
"last_name": "Ortiz"
},
{
"id": 2,
"first_name": "Albert",
"last_name": "Williamson"
},
{
"id": 3,
"first_name": "Mildred",
"last_name": "Fuller"
},
{
"id": 4,
"first_name": "Russell",
"last_name": "Robinson"
},
{
"id": 5,
"first_name": "Laura",
"last_name": "Harper"
},
{
"id": 6,
"first_name": "Larry",
"last_name": "Sanders"
},
{
"id": 7,
"first_name": "Michael",
"last_name": "Rice"
},
{
"id": 8,
"first_name": "Sara",
"last_name": "Harris"
},
{
"id": 9,
"first_name": "Phyllis",
"last_name": "Webb"
},
{
"id": 10,
"first_name": "Roger",
"last_name": "Alvarez"
}
]
이제 설정이 완료되었습니다. 다음으로 실제 배치 요청을 실행합니다.
2. 일괄 요청 실행
데이터를 삽입할 것이므로 동적 데이터를 허용하도록 '데이터 삽입' 요청을 수정해야 합니다. 이 같은

그런 다음 컬렉션을 실행해야 합니다.

그리고 'Insert Data' 요청과 함께 seedData.json 파일을 선택합니다(그런 다음 'Run Data Endpoints' 버튼 클릭).

배치 요청을 실행하고 다음과 같은 결과를 제공합니다.

Get Data 요청을 사용하여 데이터 삽입을 다시 검증할 수 있습니다.

그리고 그게 다야. 이것이 귀하의 프로젝트에 도움이 되기를 바랍니다. 감사합니다 😉
Reference
이 문제에 관하여(Postman에서 일괄 요청 실행), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/rhuzaifa/running-batch-requests-in-postman-13ml텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)