Example: Marking the download log
Here’s a sample POST request that marks the system logs with the message Mark the log. The request is made using a system-level user account that includes the administrator role.
Request with cURL command line
curl -X POST -k -i -H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382" "https://admin.hcp.example.com:9090/mapi/logs?mark=Mark+the+log"
Request in Python using PycURL
import pycurl markMessage = "Mark+the+log" curl = pycurl.Curl() curl.setopt(pycurl.VERBOSE, True) curl.setopt(pycurl.CUSTOMREQUEST, "POST") curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP \ YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"]) curl.setopt(pycurl.URL, ("https://admin.hcp.example.com:9090/mapi/logs/?" + "mark="Mark+the+log")) curl.setopt(pycurl.SSL_VERIFYPEER, False) curl.setopt(pycurl.SSL_VERIFYHOST, False) curl.perform() curl.close()
Request headers
POST /mapi/logs?mark=Mark+the+log HTTP/1.1 Host: admin.hcp.example.com:9090 Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382
Response headers
HTTP/1.1 200 OK X-HCP-SoftwareVersion: 9.0.0.2 Content-Length: 0