-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers๐ Small
Milestone
Description
The objective is to replicate this feature in HTTPie: https://httpie.io/docs/cli/redirected-input
Accept user for passing request data is through redirected stdin (standard input)โpiping.
Receiving the inputs from this method is similar to using --raw flag with the content passed in stdin.
treq PUT api.com/put < files/data.jsonecho -n '{"name": "John"}' | http PATCH api.com/patch Auth:NoneThese three command are equivalent (consider the file.json with content as {"name": "Thales"})
treq POST api.com/post --raw '{"name": "Thales"}'
echo '{"name": "Thales"}' | treq POST api.com/post
treq POST api.com/post < file.json
cat file.json | treq POST api.com/postAdditional Considerations:
It's really important use the same abstraction used by --raw flag. That way is even possible to merge the input from this with request items.
This command
echo '{ "name": "John", "age": 21 }' | treq POST api.com/post job=dev role=adminwould request with body...
{
"name": "John",
"age": 21,
"job": "dev",
"role": "admin"
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers๐ Small
Projects
Status
๐ Backlog