C.W.K.
Stream
Lesson 03 of 06 · published

httpie / Postman / Insomnia — 실제 잡을 도구

~9 min · production, httpie, postman, insomnia, gui-clients

Level 0HTTP Newbie
0 XP0/46 lessons0/12 achievements
0/120 XP to next level120 XP to go0% complete
"curl 이 request 하나 X-ray 위한 것. API 탐색, request 저장, collection 빌드, 팀과 공유 위해선 더 친절한 도구 잡아. 셋 알 만 함."

httpie — 더 좋은 기본 가진 curl

httpie 가 JSON API 위한 sane 기본 가진 curl 대안. JSON 이 기본 body format; pretty-printing 켜짐; 기본 colorized 출력. brew/pip 통해 한 번 설치; 즉시 사용 가능.

# curl POST + JSON 의 httpie 등가
http POST https://api.example.com/users name=Pippa email=pippa@example.com

# Auth + header + JSON body
http POST https://api.example.com/users \
  Authorization:'Bearer abc' \
  Content-Type:'application/json' \
  name=Pippa

# Query param 가진 GET
http GET https://api.example.com/users role==admin status==active

문법 주목: key=value 가 JSON body 필드; key==value 가 query parameter; Header:value 가 header. Ad-hoc 작업에 curl 의 flag soup 보다 외우기 쉬움.

Postman — 팀 API 작업대

Postman 이 코끼리: 환경 변수로 parameterize 된, 팀 간 공유 가능, 자동 test 로 돌릴 수 있는 request collection 빌드하는 desktop/web/CLI client. 헤드라인 기능:

  • Collection — 공유 auth 와 변수 가진 관련 request 폴더.
  • Environment — dev / staging / prod target 때 swap 하는 변수 set ({{base_url}}, {{token}}).
  • Test — Response (status code, body shape) 에 대해 assert 하는 JavaScript snippet. Newman (Postman CLI) 통해 자동 CI test suite 로 돌림.
  • Mock server — OpenAPI spec 이나 collection 에서 stub server 생성.
  • Documentation — Collection 에서 API docs 자동 생성.

통합 팀, QA, 제 3자 API 탐색하는 개발자가 씀. 무료 tier 가 대부분 개인 사용 커버; team plan 이 협업 기능 추가.

Insomnia — 더 조용한 대안

Insomnia 가 Postman 의 더 lean 한 sibling: 같은 collection 모델, 같은 환경 변수, 같은 test, 더 단순 UI. Open-source core (Kong 이 회사 인수했는데 Insomnia 오픈 유지). Postman 무겁게 느끼면 Insomnia 가 swap.

구별 기능:

  • 내장 GraphQL 지원 (스키마 introspection 가진 query editor).
  • gRPC 지원 (GUI 에서 native gRPC service 호출).
  • OpenAPI/Swagger import 로 collection bootstrap.
  • Custom auth scheme 위한 plugin 생태계.

Bridge 패턴: GUI 에 저장, CI 에서 run

흔한 workflow: Postman/Insomnia 에서 API 인터랙티브 탐색, 동작하는 request 를 collection 에 저장, 그 다음 그 collection 을 Newman (Postman) 이나 Inso CLI (Insomnia) 통해 CI 의 자동 test 로 run. 같은 request; 다른 런타임. 이게 팀이 "내 머신에서 동작" 에서 "CI 에서 동작" 으로 가는 방법.

Wire 하나 X-ray 엔 curl; ad-hoc JSON 엔 httpie; collection 과 팀 flow 엔 Postman/Insomnia. 작업에 맞는 가장 가벼운 도구 써. 실수가 one-off curl 작업에 Postman (과잉) 혹은 collection 관리에 curl (도구 부족).

cwkPippa 의 tooling

cwkPippa 개발이 ad-hoc 모든 거에 curl 씀 — single-user dev, collection 관리 불필요. /docs 의 FastAPI 자동 생성 Swagger UI 가 Postman 없이 (endpoint 클릭, form 채우고, live response 봄) 내장 browser 기반 API explorer 서빙. cwk-site 가 Supabase + Vercel stack 에 대한 통합 test 위해 CI 에서 Postman 씀 — Newman 이 모든 PR build 에 collection run, test 실패에 merge 차단. 다른 stage 에 다른 도구.

Code

httpie — JSON-first, curl 보다 단순 문법·bash
# httpie cheat sheet (curl 와 비교)

# 한 번 설치
brew install httpie  # 혹은 pip install httpie

# Query param 가진 GET
http GET https://api.example.com/users role==admin

# JSON POST (자동 감지)
http POST https://api.example.com/users name=Pippa email=pippa@example.com

# Custom header (colon, -H 아님)
http GET https://api.example.com/me Authorization:'Bearer abc'

# stdin 에서 raw body 보내기
echo '{"name":"Pippa"}' | http POST https://api.example.com/users

# Binary download
http --download https://example.com/file.zip
Postman: JavaScript test snippet + 변수 chaining·javascript
// Postman test snippet — response 에 assert
pm.test('200 돌려줌', () => {
  pm.response.to.have.status(200);
});

pm.test('body 에 user id 있음', () => {
  const body = pm.response.json();
  pm.expect(body.id).to.be.a('string');
  pm.expect(body.id).to.match(/^u_/);
});

pm.test('response time 500ms 아래', () => {
  pm.expect(pm.response.responseTime).to.be.below(500);
});

// Request chaining 위한 Postman 변수
const id = pm.response.json().id;
pm.environment.set('last_user_id', id);  // 다음 request 에 {{last_user_id}} 로 가용
Newman: 같은 Postman collection, CI 에서 run·bash
# Newman — CI 의 Postman collection
npm install -g newman
newman run my-collection.postman_collection.json \
  --environment production.postman_environment.json \
  --reporters cli,junit \
  --reporter-junit-export results.xml

# CI 가 results.xml 써서 test pass/fail surface.
# 인터랙티브 돌린 같은 request 가 이제 자동 test gate.

External links

Exercise

httpie 설치 (brew install httpie). 자주 쓰는 curl 명령 셋 고르고 httpie 문법으로 다시 써. 가독성 비교. 그 다음 어느 FastAPI app 있으면 /docs endpoint 열고 한 POST endpoint 에 'Try it out' 버튼 써 — 자동 생성 Swagger UI 가 개인 탐색에 Postman 이 할 거 대부분 어떻게 대체하는지 느껴. 보너스: Postman 이나 Insomnia 설치, {{base_url}}{{token}} 환경 변수 가진 3-5 request 의 collection 만들고, 각 request 편집 없이 dev 와 prod 환경 swap.
Hint
httpie 의 가장 큰 승리가 JSON: name=Pippa age:=25 가 자동 {"name":"Pippa","age":25} 됨. := 문법이 httpie 한테 값이 non-string 임 알림. FastAPI 의 /docs 가 대부분 프로젝트가 underuse 하는 killer 기능 — FastAPI service 만드는 모든 개발자가 Postman-shaped 도구 공짜로 얻음. Postman/Insomnia 의 변수가 request parameterize; 환경 swap 이 한 클릭.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.