Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--url-query for curl #9691

Closed
wants to merge 3 commits into from
Closed

--url-query for curl #9691

wants to merge 3 commits into from

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
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
bagder added 3 commits Nov 4, 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
@bagder bagder closed this in b6e1afd Nov 8, 2022
@bagder bagder deleted the bagder/url-query branch Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant