Posted on 09-28-2016 07:52 PM
I'm trying to delete a policy vie the API, however I'm getting "400 bad request" in return. My account has full admin rights and I can GET, PUT, and POST just fine to the same policy. DELETE works for other stuff like Categories and Buildings. I double checked the policy list and I'm trying to delete the right policy ID. Am I missing something simple?
example:
curl -v -uadmin -p https://my.jss.com:8443/JSSResource/policies/id/48 -X DELETE
response:
< HTTP/1.1 400 Bad Request
< Transfer-Encoding: chunked
< Date: Thu, 29 Sep 2016 02:46:09 GMT
< Connection: close
< Server: Apache
Solved! Go to Solution.
Posted on 09-29-2016 08:02 AM
nevermind, figured it out. Forgot to quote my URL string....
does not work: curl -v -uadmin -p https://my.jss.com:8443/JSSResource/policies/id/48 -X DELETE
works:
curl -v -uadmin -p "https://my.jss.com:8443/JSSResource/policies/id/48" -X DELETE
also, if you want curl to output the HTTP response code, add this: -w "
response code:%{http_code}
"
makes error checking a lot easier.
Posted on 09-29-2016 08:02 AM
nevermind, figured it out. Forgot to quote my URL string....
does not work: curl -v -uadmin -p https://my.jss.com:8443/JSSResource/policies/id/48 -X DELETE
works:
curl -v -uadmin -p "https://my.jss.com:8443/JSSResource/policies/id/48" -X DELETE
also, if you want curl to output the HTTP response code, add this: -w "
response code:%{http_code}
"
makes error checking a lot easier.