Closed shaleh closed 10 years ago
Thanks! But have you tried passing the data via stdin
?
$ echo $SOAP | http POST "$URL" 'SoapAction:http://example.com/SomeAPIMethod' 'Host:soap.example.com' 'Content-Type:text/xml; charset=utf-8'
Thanks. I figured I was missing something. I still see value in the command line option though. If you do too I'd be happy to submit a pull request.
On August 8, 2014 4:34:03 PM PDT, "Jakub Roztočil" notifications@github.com wrote:
Thanks! But have you tried something passing the data via
stdin
?$ echo $SOAP | http POST "$URL" 'SoapAction:http://example.com/SomeAPIMethod' 'Host:soap.example.com' 'Content-Type:text/xml; charset=utf-8'
Reply to this email directly or view it on GitHub: https://github.com/jakubroztocil/httpie/issues/247#issuecomment-51668933
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Now and then I need to talk SOAP. I know, yuck :-) I can do this with curl by passing my SOAP body via -d/--data. I could not find a way to accomplish the same thing with httpie so I hacked this in real quick. Sorry, I do not have the ability to fork and offer a pull request at the moment. Besides, maybe I missed something and this patch is not needed.
If this were to be properly included I suspect a warning/error when both foo=bar and --data is used.
Making the function used to populate args.data from items smarter would require adding some magic keyword like 'rawdata:=blah' and ensuring the parser does not attempt to inspect blah at all. This is why I added a --data option instead.
If this functionality really is missing I can fork and make a proper pull request when time allows.
Note my example script at the end makes it look like potentially the data could be read from a file. But I would really like to keep it all contained in the script. However, I could see extending --data to allow the input to be read from a file like the positional arguments do.
It looks like this in use: