Comments (8)
My patch in #56 resolves the first issue (every key no longer needs a value). While replacing the existing entry is not always what you want, it is a more common use case, so I would propose:
query-set
continues to replace if the specified name already existsquery-add
always adds a new element
This is much more consistent with the common meanings of 'set' and 'add' in most programatic environments. As an aside, with the internal refactoring of query string management included in the patch, implementing query-add is pretty trivial.
What is the difference between query-unset NAME
and query-remove NAME
?
from htty.
query-remove NAME
removes the last value keyed by NAME, whereas query-unset NAME
would remove all values keyed by NAME.
from htty.
Ah, makes sense. May I propose query-remove NAME [VALUE]
where if value is not specified it does as you suggest, but if value is specified it removes that specific instance?
from htty.
Excellent idea. I’ll apply it to ‘cookie-remove’, too.
from htty.
The patch in #63 should close this issue.
from htty.
query-add
, query-remove
, and query-set
are all working as desired now.
I like the enhancement you made to the concept of query-remove
that looks for matches by both name and value. It would be good if query-unset
worked this way, too:
query-add NAME [VALUE [NAME [VALUE ...]]]
query-remove NAME [VALUE]
query-set NAME [VALUE [NAME [VALUE ...]]]
query-unset NAME [VALUE]
query-unset-all
from htty.
So something like query-unset foo
would remove all instances of foo
in the query string regardless of value and query-unset foo bar
would only remove instances that were foo=bar
?
from htty.
That’s what I was thinking, yes.
from htty.
Related Issues (20)
- `query-remove` without a request blows up HOT 1
- body-from-file command
- Commands with multiline input
- Slashes in `cd` command are URL-encoded HOT 7
- Cursor misbehaves if prompt line is larger than terminal width HOT 2
- Proxy support HOT 2
- `strip!': can't modify frozen String (RuntimeError) HOT 1
- Monospace font for code/pre on the site HOT 1
- Transition to Ruby v2.x HOT 1
- Allow returning to previous URI HOT 3
- Accessible examples HOT 3
- Allow patch to send body HOT 1
- Non-Basic Authorization header doesn’t persist after changing path HOT 3
- Ruby v2.1 breaks `body-response-open` and `body-request-open` due to change in temp file extension
- Report response times HOT 2
- Add a command for pretty-printing JSON
- Uninitialized constant HTTY::CLI::HTTPMethodCommand::OpenSSL on a fresh install HOT 4
- Set a default configuration HOT 1
- Add UI test coverage using Aruba Cucumber features
- Following relative URLs is not an idempotent operation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htty.