Curl: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „Kategorie:Applikation = Wichtige Optionen = * -k Erlauben von selbsterzeugten Zertifikaten bei Verwendung von https * -v Liefert nicht den Inhalt, sondern…“)
 
 
Zeile 11: Zeile 11:
<source lang="bash">
<source lang="bash">
# POST
# POST
curl --data '{ name: "Jonny" }' http://sv.com:5812/register
curl --data '{ name: "Jonny" }' -H "Content-Type: application/json" http://sv.com:5812/register
# Datei als Inhalt:
# Datei als Inhalt:
curl -d @request.json -H "Content-Type: application/json" http://sv.com:8082/spring-rest/foos/new
curl -d @request.json -H "Content-Type: application/json" http://sv.com:8082/spring-rest/foos/new

Aktuelle Version vom 11. Oktober 2021, 18:47 Uhr

Wichtige Optionen[Bearbeiten]

  • -k Erlauben von selbsterzeugten Zertifikaten bei Verwendung von https
  • -v Liefert nicht den Inhalt, sondern Info über Weiterleitungen etc.
  • -d POST Daten
  • -X METHOD Methode: GET POST PUT DELETE HEAD PATCH
  • -o FILE Speichert das Ergebnis in FILE


Beispiele[Bearbeiten]

# POST
curl --data '{ name: "Jonny" }' -H "Content-Type: application/json" http://sv.com:5812/register
# Datei als Inhalt:
curl -d @request.json -H "Content-Type: application/json" http://sv.com:8082/spring-rest/foos/new
# PUT:
curl --upload-file flower.png http://www.example.com/receive.cgi