Difference between revisions of "Curl -X"

From wikieduonline
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{lowercase}}
+
{{lowercase}}__NOTOC__
 
+
== PUT ==
 
* <code>curl -X [[PUT]] [[-u]] myUser:myPassword [[curl -T|-T]] test.txt "http://your_artifactory.com/artifactory/libs-release-local/test/test.txt"</code>
 
* <code>curl -X [[PUT]] [[-u]] myUser:myPassword [[curl -T|-T]] test.txt "http://your_artifactory.com/artifactory/libs-release-local/test/test.txt"</code>
  
* <code>[[curl -X POST]] -F 'name=linuxize'</code>
+
== POST ==
* <code>[[curl -X POST --data]]</code>
+
{{curl -X POST TOC}}
* <code>curl -X POST --insecure</code>
 
* <code>curl -X POST [[--compressed]]</code>
 
* <code>[[curl -X POST -d]]</code>
 
* <code>[[curl -X POST -H]]</code>
 
* <code>[[curl -X POST -H]] "[[Content-Type: application/json]]"</code>
 
 
 
 
 
* <code>[[curl -X GET]]</code>
 
* <code>[[curl -X DELETE]]</code>
 
 
 
 
 
  [[curl -XGET https://localhost:9200]] -u 'admin:admin' [[--insecure]]
 
 
 
 
  [[curl -X POST]] --insecure https://your_elk_ip:YOUR_PASS@localhost:9200/_snapshot/gcs_repo/your_latest_snapshot_name/_restore
 
  [[curl -X POST]] --insecure https://your_elk_ip:YOUR_PASS@localhost:9200/_snapshot/gcs_repo/your_latest_snapshot_name/_restore
 
  
 
  curl -X POST --data '{
 
  curl -X POST --data '{
Line 27: Line 13:
 
  }' -H '[[content-type:application/json]];' 127.0.0.1:[[9650]][[/ext/info]]
 
  }' -H '[[content-type:application/json]];' 127.0.0.1:[[9650]][[/ext/info]]
  
* <code>[[curl -X POST]]</code>
+
== GET ==
 +
* <code>[[curl -X GET]]</code>
 +
  [[curl -XGET https://localhost:9200]] -u 'admin:admin' [[--insecure]]
 +
 
 +
== DELETE ==
 +
* <code>[[curl -X DELETE]]</code>
 +
 
  
[[curl --help]]
+
== [[curl --help]] ==
 
  .../...
 
  .../...
 
  -X, [[--request]] <command> Specify request command to use
 
  -X, [[--request]] <command> Specify request command to use
Line 50: Line 42:
 
== See also ==
 
== See also ==
 
* {{POST}}
 
* {{POST}}
 +
* {{curl -X}}
 
* {{curl}}
 
* {{curl}}
  
 
[[Category:Curl]]
 
[[Category:Curl]]

Latest revision as of 08:35, 14 August 2024

PUT[edit]

POST[edit]

curl -X POST --insecure https://your_elk_ip:YOUR_PASS@localhost:9200/_snapshot/gcs_repo/your_latest_snapshot_name/_restore
curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"info.getNodeID"
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info

GET[edit]

 curl -XGET https://localhost:9200 -u 'admin:admin' --insecure

DELETE[edit]


curl --help[edit]

.../...
-X, --request <command> Specify request command to use
   --request-target Specify the target for this request
   --resolve <host:port:address[,address]...> Resolve the host+port to this address
   --retry <num>   Retry request if transient problems occur
   --retry-connrefused Retry on connection refused (use with --retry)
   --retry-delay <seconds> Wait time between retries
   --retry-max-time <seconds> Retry only within this period
   --sasl-ir       Enable initial response in SASL authentication
   --service-name <name> SPNEGO service name

Examples[edit]

  • TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")

Related[edit]

See also[edit]

Advertising: