micha / resty

Little command line REST client that you can use in pipelines (bash or zsh).
MIT License
2.65k stars 143 forks source link

'-W' needs to be *after* URL prefix argument. README says otherwise. #10

Closed trentm closed 13 years ago

trentm commented 13 years ago

Hello,

At least for me on a Solaris box I've found that this example in the README doesn't work:

. /path/to/resty -W 'https://myhost.com/data*.json'

For the equivalent to work for me, I needed to use the '-W' after the URL prefix argument like so:

. /path/to/resty 'https://myhost.com/data*.json' -W

A concrete example: Here I've added an "echo" statement to show the 'curl' command-line that is being called. Hopefully that gives you enough of a hint:

[root@mybox ~]# . resty/resty -W 'http://10.99.99.8:8080*'
[root@mybox ~]# GET /
curl -sLv  -X GET -b /root/.resty/c/-W -c /root/.resty/c/-W http://-W/
[root@mybox ~]# . resty/resty  'http://10.99.99.8:8080*' -W
[root@mybox ~]# GET /
curl -sLv  -X GET -b /root/.resty/c/10.99.99.8:8080 -c /root/.resty/c/10.99.99.8:8080 http://10.99.99.8:8080/
<errors>
  <error>Not authorized
</error>
</errors>
[root@mybox ~]# 

Where, in my case that "..." XML output is the expected response.

Ideas? It is possible this is a Solaris vs. Linux difference, but I haven't traced through the Bash code path handling '-W'.

micha commented 13 years ago

Ah. That was a bug. It should work correctly (as in the README) now. Thanks!