Difference between revisions of "Curl --header"

From wikieduonline
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
<code>curl --header or  [[curl -H]]</code>
 
<code>curl --header or  [[curl -H]]</code>
 +
 +
 +
  -H "[[Authorization: Bearer]] ..."
  
 
== Examples ==
 
== Examples ==
Line 12: Line 15:
  
 
  curl \
 
  curl \
   -H "[[Authorization]]: [[Bearer]] "$(gcloud auth application-default print-access-token) \
+
   -H "[[Authorization: Bearer]] "$(gcloud auth application-default print-access-token) \
 
   -H "[[Content-Type]]: application/json; charset=utf-8" \
 
   -H "[[Content-Type]]: application/json; charset=utf-8" \
 
   https://analyticsadmin.googleapis.com/v1alpha/accounts
 
   https://analyticsadmin.googleapis.com/v1alpha/accounts
 +
 +
 +
[[curl $APISERVER/api]] --header "[[Authorization:]] Bearer $TOKEN" --insecure
  
 
== Related ==
 
== Related ==
Line 20: Line 26:
 
* [[HTTP headers]]
 
* [[HTTP headers]]
 
* [[Display HTTP response headers]]: <code>[[curl -v]]</code>
 
* [[Display HTTP response headers]]: <code>[[curl -v]]</code>
[[curl: no URL specified!]]
+
* [[curl: no URL specified!]]
 +
* [[Access Kubernetes REST API using default token]]
 +
* [[8551]]
  
 
== See also ==
 
== See also ==

Latest revision as of 15:17, 8 May 2024

Advertising: