curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

--url-query for curl

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Tue, 11 Oct 2022 12:10:23 +0200 (CEST)

Hi,

I'm proposing this new command line option to a curl in a new PR[1] of mine.

Using this, you append data to the end of the query part of the URL, properly
URL encoded.

Example:

   curl --url-query "name=Daniel Stenberg" \
     --url-query "street=$address" \
     --url-query "description_at_desc.txt" \
     https://example.com/

The syntax for this option is the same as used for --data-urlencode already.

A keen reader will notice that you can do the same as the command line above
already with the use of --data-urlencode and --get, but that is limited to GET
operations only. With this new proposed option, you can use *both* --url-query
and --data-urlencode in the same command line, if you want to POST and also
create a set of query value pairs.

This is just a first shot. Feel free to test, comment, complain or praise the
idea, the name, the tests, the documentation or anything else in the GitHub
pull request.

It can obviously not be merged until the feature window opens anyway, at the
earliest on October 31, 2022.

[1] = https://github.com/curl/curl/pull/9691

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-10-11