2014-04-06 10 views

risposta

19

dati di richiesta Verbatim possono essere specificati via redirected STDIN:

$ echo '{}' | http httpbin.org/post 

Si noti che per le richieste che includono un corpo:

+0

In Windows, le virgolette singole in 'echo' {} '| http httpbin.org/post' può omettere. just 'echo {} | http httpbin.org/post' – Edward

4
http POST ooxx.asdf/ Content-Type:application/json '{}' 

Un'altra opzione utilizzando il file JSON che contiene {}:

http POST ooxx.asdf/ < file.json 

più su JSON distacco è possibile find from here.

+1

http: errore: argomento RICHIEDI PRODOTTO: "{}" non è un valore valido – Drake

+0

@Sabuj Hassan 'http POST ooxx.asdf/Content-Type: application/json '{}'' non funziona. È in questo modo pubblicare testo json usando httpie? – Edward

Problemi correlati