... νμΆκ³Ό λ λ€λ₯Έ λ§λ²μμ΄
μ§μ§μΌ?
--raw-payload
μ κ°μ μ΅μ
μλ
μ, STDIN
λ₯Ό ν΅ν΄ μ λ¬ λ λͺ¨λ λ°μ΄ν°λ μμ² λ³Έλ¬ΈμΌλ‘ μ μ‘λ©λλ€. μ :
$ echo 'raw payload' | http httpbin.org/post
κ³ λ§μ, Jakub!
μ΄μΈμ --ignore-stdin
λ΄κ° μμΌλ‘μ΄μ λν μΈκΈμ΄ νμλμ§ μμ΅λλ€ http --help
, κ·Έκ²μ λμλ§ ν
μ€νΈμ μ’μ μΆκ° λ μ μμκΉμ? (λν μ΄κ²μ λν λ©μ§ μμ
!)
http httpbin.org/post <<< 'raw payload'
λ μ¬μ©ν μ μμ΅λλ€.
κ·Έλ¬λ,
$ echo 'running' | http -v put localhost:5000/state
Content-Type: application/json
ν€λλ₯Ό 보λ΄κ³ μμ΅λλ€.
PUT /state HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 8
Content-Type: application/json
Host: localhost:5000
User-Agent: HTTPie/0.9.9
running
μμ μΈ‘μμ μ μ ν ꡬνμ λ¬Όλ‘ JSONμΌλ‘ ꡬ문 λΆμμ μλνκ³ μ€ν¨ν©λλ€.
@furkanmustafa application/json
λ httpie
μ¬μ©νλ κΈ°λ³Έ μ½ν
μΈ μ νμ
λλ€.
μμ²μ μ½ν μΈ μ νμ λͺ μ μ μΌλ‘ λͺ μνλ©΄ λ€μκ³Ό κ°μ΄ ν΄κ²°λ©λλ€.
$ echo 'running' |http httpbin.org/post Content-Type:text/plain
λλ μμΆ λ μ½ν μΈ λ₯Ό 보λ΄λ κ²½μ°μλ :
$ echo 'running' |gzip |http httpbin.org/post Content-Type:text/plain Content-Encoding:gzip
http httpbin.org/post <<< 'raw payload'
λ μ¬μ©ν μ μμ΅λλ€.
powershellμμ μλνμ§ μλ κ² κ°μμ΅λλ€. 'rawBody' | http post :8080/api/events
κ° μ μκ² ν¨κ³Όμ μ΄μμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
μ,
STDIN
λ₯Ό ν΅ν΄ μ λ¬ λ λͺ¨λ λ°μ΄ν°λ μμ² λ³Έλ¬ΈμΌλ‘ μ μ‘λ©λλ€. μ :https://github.com/jakubroztocil/httpie#redirected -input