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

Requests that return "<url> malformed" also return last request's response #28

Closed BigBlueHat closed 7 years ago

BigBlueHat commented 13 years ago

If you:

resty http://localhost:5984
GET /test

It returns the expected result (information about the CouchDB database I'm getting info about).

However, if I do that, and then type it again--forgetting the opening slash:

GET test

I get:

* <url> malformed
* <url> malformed
* getaddrinfo(3) failed for test:80
* Couldn't resolve host 'test'
* Closing connection #0
* About to connect() to localhost port 5984 (#0)
*   Trying 127.0.0.1... connected

and the remainder (headers and content) of my earlier request.

What I'd expect is the "Couldn't resolve host 'test'" response.

Thanks.

mdi commented 12 years ago

This happens with a leading slash also.

AdrieanKhisbe commented 7 years ago

This is a feature

If the path parameter is not provided on the command line, resty will just use the last path it was provided with.

I'm gonna see if it's possible to disable it has a feature for 3.0

AdrieanKhisbe commented 7 years ago

there is now the feature to disable it