REST API - HTTP DELETE Method
2 min
what should i do if i cannot use the delete method? in some environments, the firewall may not support the delete method, or the delete method may be disabled it is possible to use http post method instead of http delete to submit information using the http post method instead of http delete, you must add the following information to the request header to override the post method x http method override delete python example def delete artifact() \# obtain a token from our get token() function token = get token() \# of course, this ids would generally come from somewhere else instead of hardcoding it project id = "115387" artifact id = "115933" \# build the resource uri for listing artifacts in a given project resource uri = 'https //production blueprintcloud com/api/v1/projects/' + project id + '/artifacts/' + artifact id \# specify header parameters request header={ 'authorization' 'blueprinttoken ' + token, 'accept' 'application/json', 'x http method override' 'delete' } \# create the request uri (add params if it's needed) request uri = resource uri \# create the request body request body = "" \# submit the request using http post method response = requests post(request uri, request body, headers=request header) return response