Curl (Linux): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 15: Zeile 15:
-F "file=@/mnt/c/Users/Martin/Downloads/Test.xlsx" \
-F "file=@/mnt/c/Users/Martin/Downloads/Test.xlsx" \
http://localhost:8080/import-test/rest/importer/excel?_csrf=36af42c6-7988-4ccb-a11d-6bb9ebdd3b69
http://localhost:8080/import-test/rest/importer/excel?_csrf=36af42c6-7988-4ccb-a11d-6bb9ebdd3b69
</pre>
=== Senden eines DELETE-Calls ===
<pre>
curl -X DELETE \
-H "Cookie: XSRF-TOKEN=4774ac4b-a992-40e1-969c-61576997348c; JSESSIONID=9CF84EE9A98185A2926303F9B6AA2593" \
http://localhost:3000/delete-test/rest/delete?id=1&_csrf=4774ac4b-a992-40e1-969c-61576997348c
</pre>
</pre>



Version vom 17. Dezember 2020, 19:57 Uhr

Installation

sudo apt-get install -y curl

Verwendung

Upload einer Multipart-Datei

curl -X POST \
-H "Content-Type: multipart/form-data" \
-H "Cookie: JSESSIONID=A745FE67D2D13D24526261CBBA6883FB; XSRF-TOKEN=36af42c6-7988-4ccb-a11d-6bb9ebdd3b69" \
-F "file=@/mnt/c/Users/Martin/Downloads/Test.xlsx" \
http://localhost:8080/import-test/rest/importer/excel?_csrf=36af42c6-7988-4ccb-a11d-6bb9ebdd3b69

Senden eines DELETE-Calls

curl -X DELETE \
-H "Cookie: XSRF-TOKEN=4774ac4b-a992-40e1-969c-61576997348c; JSESSIONID=9CF84EE9A98185A2926303F9B6AA2593" \
http://localhost:3000/delete-test/rest/delete?id=1&_csrf=4774ac4b-a992-40e1-969c-61576997348c

Links

https://curl.haxx.se/docs/manpage.html


Zurück zu Ubuntu