micha / resty

Little command line REST client that you can use in pipelines (bash or zsh).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

BigBlueHat opened this issue · comments

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.

This happens with a leading slash also.

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

there is now the feature to disable it