Replies: 4 comments 9 replies
-
This sounds related to #9691
|
Beta Was this translation helpful? Give feedback.
-
I don't think I understand why this is useful. Can you make up some examples of how a few use cases would look like? |
Beta Was this translation helpful? Give feedback.
-
I think @bagder's script example is sufficient and an option in curl too niche. Also, you can put --oauth2-bearer in a curl configuration file if you don't want to show the bearer token on the command line, for example curl -K bearer.cfg. How are you getting the bearer token? I have some scripts that do it: https://github.com/jay/curl_google_oauth |
Beta Was this translation helpful? Give feedback.
-
I actually think something like This would probably allow me to for example write the 4 curl commands in this README.md in a much nicer looking one-liner. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to set myself up with shell script helper functions that are essentially wrappers around
curl
with some pre-specified options. (E.g.--oauth2-bearer
,--cookie
, etc.)It'd be nice to be able to specify a base-url that main URL argument ends up being concatenated to!
curl/lib/urlapi.c
Lines 231 to 240 in 4ab601d
This would allow me to call e.g. my Gmail API helper as
gmail /threads\?labelIds=STARRED
to get all my starred Gmail threads instead of having to source the base URL from somewhere else (e.g. from memory, a separate helper function, etc.).When specified, a main URL argument would still be required, but it would be passed to
concat_url
before executing the request. Successive--base-url
options could either be concatenated together or last one could win - not clear to me which is better.Only previous mention I've found of this idea is in a mailing list email from 2006.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions