New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove need for quotes to be escaped for raw json input #77
Comments
@avisser It would be nice not having to escape it but the JSON simply needs to be valid after the arguments have been processed by the shell, so it's unfortunately necessary. Otherwise it would require an error-correcting JSON parser to allow unquoted strings. You can also wrap the whole argument with single quotes (
(Tip: |
I was worried that might be the case. Thanks for the alternatives. Might I suggest using one of your examples in the readme.rst? The fact that
and
both work drove me crazy for a few minutes. Great utility. Keep up the good work. |
Good idead, I'll update the README. Cheers |
Still getting below error when i pass with quotes from cmd line 'meals:=["ham", "spam"]' (i notice in the documentation you use = and not := though I tried both) http-script.py: error: argument REQUEST ITEM: "spam]'" is not a valid value |
to pass string arrays in json from cmd line, i found the below option working: meals:=["ham","spam"] thanks btw for this great project. |
meals:='["ham","spam"]' with (or without) quotes doesn't work on windows cmd. I have to use '' escapes. |
I misread you comments, but have corrected my answer in the meantime. Sorry for the confusion. Okay, I understand, there is this nested quoting incompatibility between bash and cmd.exe. I will update the docs accordingly. Thanks. |
Hello. I have just installed httpie and I am trying to perform some aggregate queries on a data base on my local machine. I got the error message; http-script.py: error: argument REQUEST_ITEM: "[" is not a valid value What can I do to resolve this? I have tried several options but no success. Below I attach a screenshot of my console |
While it may be intentional, it is quite unintuitive that you need to escape your quotes for raw json input
but
This is in OSX terminal - 10.7.4.
The text was updated successfully, but these errors were encountered: