User Tools

Site Tools


rest-api:curl

Send a rest api request via curl

curl -u user:pwd "https://<host>:<port>/<rest-endpoint>" -k -v -X POST -H "Content-Type: application/json" -d '{"sortColumn":"name","sortDirection":"asc","filters":[]}' > out.txt
  1. Username: user
  2. Password: pwd
  3. HTTP Method: POST
  4. Headers:
    1. Content-Type: application/json
  5. Data/Payload: {“sortColumn”:“name”,“sortDirection”:“asc”,“filters”:[]}
  6. Output: The output of the command will be redirected to a file named out.txt.
  7. -k: This option allows curl to proceed and operate even for server connections otherwise considered insecure.
  8. -v: Makes the operation more talkative. You can see information about the SSL certificate, the headers, and more.
rest-api/curl.txt · Last modified: 2023/09/29 14:06 by odefta