Skip to content

--url-query for curl#9691

Closed
bagder wants to merge 3 commits intomasterfrom
bagder/url-query
Closed

--url-query for curl#9691
bagder wants to merge 3 commits intomasterfrom
bagder/url-query

Conversation

@bagder
Copy link
Member

@bagder bagder commented Oct 10, 2022

This option adds a piece of data, usually a name + value pair, to the end of the URL query part. The syntax is identical to that used for --data-urlencode with one extension:

If the argument starts with a + (plus), the rest of the string is provided as-is unencoded.

This allows users to "build" query parts with options and URL encoding even when not doing GET requests, which the already provided option -G (--get) is limited to.

@bagder bagder added cmdline tool feature-window A merge of this requires an open feature window labels Oct 10, 2022
@bagder
Copy link
Member Author

bagder commented Oct 11, 2022

Note

This format does not URL encode the left side of the name=value pairs. It assumes that side is already encoded. This was something I decided when I made the --data-urlencode option because if it isn't encoded, it might contain a = and then we cannot know which is part of the name and which is separator.

The =content syntax will URL encode the entire thing.

bagder added a commit that referenced this pull request Oct 30, 2022
This option adds a piece of data, usually a name + value pair, to the
end of the URL query part. The syntax is identical to that used for
--data-urlencode with one extension:

If the argument starts with a '+' (plus), the rest of the string is
provided as-is unencoded.

This allows users to "build" query parts with options and URL encoding
even when not doing GET requests, which the already provided option -G
(--get) is limited to.

This idea was born in a Twitter thread.

Closes #9691
This option adds a piece of data, usually a name + value pair, to the
end of the URL query part. The syntax is identical to that used for
--data-urlencode with one extension:

If the argument starts with a '+' (plus), the rest of the string is
provided as-is unencoded.

This allows users to "build" query parts with options and URL encoding
even when not doing GET requests, which the already provided option -G
(--get) is limited to.

This idea was born in a Twitter thread.

Closes #9691
@bagder bagder removed the feature-window A merge of this requires an open feature window label Nov 8, 2022
@bagder bagder closed this in b6e1afd Nov 8, 2022
@bagder bagder deleted the bagder/url-query branch November 8, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant