HTTPie 의 자리
curl 은 스크립팅에 무적. HTTPie 는 손으로 API 탐색할 때 짧은 문법, JSON 인식, syntax-highlight 출력. brew install httpie.
합리적 default
http https://api.github.com/users/cli
# = curl -sS -H 'Accept: application/json' https://...JSON 친화 Accept 헤더 default, redirect 덜 공격적으로 따라감, JSON 색깔 출력. 출력이 문서처럼 읽힘.
30 초 안에 POST
http POST https://api.example/items name=pippa qty:=3 active:=true해석: 'JSON body {name: "pippa", qty: 3, active: true} 로 POST.' := 가 비문자열 (숫자, bool). 그냥 = 는 문자열. JSON 직접 인용할 필요 없음.
헤더 / auth / 파일
http GET https://... 'Authorization: Bearer xyz'http -a user:pass GET https://...http POST https://... < body.json— stdin 의 파일을 body 로.http --download https://.../file.zip— progress bar + 파일명 자동.
Session
http --session=mysession POST https://api/login user=alice pass=... 이 쿠키 / 헤더 / basic auth 저장. 이후 http --session=mysession ... 가 재사용. 다단계 API 탐색에 좋음.
curl 이 여전히 이기는 곳
Python 없는 미니멀 컨테이너용 스크립트. 성능 중요 루프. 이미 curl 쓰는 도구. 그 외, 특히 프롬프트에서, HTTPie 가 친절한 default.