how to use Curl cmd
curl -X POST -H "x-api-key: xscsss" -F "file=@/path/to/OLSTXNRF_tcbs_20191226_01.TXT" https://host:2189/ftpdata/tcbs/user_input/OLSTXNRF_tcbs_20191226_01.TXT
Method: POST
x-api-key: header
-F chỉ ra là file
file: là filename
@/path/to/OLSTXNRF_tcbs_20191226_01.TXT : Đường dân tới file, bao gồm cả @
------------------------------------------------------------------------------------
pull a GET request from a url or uri
pull and save response to a file
curl http://www.example.com/index.html -o out.exxxx
--------------------------------------------------------------------------------------
post data to url
curl -d '{"id":9,"name":"baeldung"}' -H 'Content-Type: application/json'
http://localhost:8082/spring-rest/foos/new
pass a file containing the request body to the data option like this:
curl -d @path/to/request.json -H "Content-Type: application/json"
http://localhost:8082/spring-rest/foos/new
curl -d @path/to/request.json -H "Content-Type: application/json"
-H "Accept: application/json" http://localhost:8082/spring-rest/foos/new
-----------------------------------------------------------------------------------------
PUT data
curl -d @request.json -H 'Content-Type: application/json'
-X PUT http://localhost:8082/spring-rest/foos/9
-----------------------------------------------------------------------------------------
Delete
curl -X DELETE http://localhost:8082/spring-rest/foos/9
------------------------------------------------------------------------------------------
Auth with Basic
curl --user baeldung:secretPassword http://example.com/
-------------------------------------------------------------------------------------------
AuthO2
curl -H "Authorization: Bearer b1094abc0-54a4-3eab-7213-877142c33fh3" http://example.com/
--------------------------------------------------------------------------------------------
dowload multiple file with curl
curl -O [URL1] -O [URL2] -O [URL3] ...
-------------------------------------------------------
Show detail request
curl -v https://www.booleanworld.com/
-------------------------------
Ref: https://curl.haxx.se/docs/manual.html
Comments
Post a Comment