When making a curl POST call with something like ... | curl -XPOST --data @- https://example.com/ can I also url-encode some url params on the command line (using curl itself, not bash funcs) without having to encode them myself and put them in the url argument to curl?
So I want the POST Body to not be urlencoded, but the url params to be url encoded within the same curl command.
So for example:
echo '{"username":"a","password": [1,2]}' | curl --header "Content-Type: application/json" --request POST -d@- --data-urlencode "filter=." http://localhost:8080
Doesn't seem to do what I want, and I have postfix my https://localhost:8080/ url with ?filter... which I would rather avoid for cases when the param needs a lot of encoding.