Cisco Cisco Prime Performance Manager 1.5 开发者指南
Cisco Prime Performance Manager1.5 REST API Guide
415
Unsupported Media Type. This status code is generated when the requested content-type
is not supported for that resource. For example, let’s say a given report is only be
available in CSV, and the client request that report using XML in the content-type. In this
case, the 415 error is generated.
is not supported for that resource. For example, let’s say a given report is only be
available in CSV, and the client request that report using XML in the content-type. In this
case, the 415 error is generated.
500
Internal Error. This error code is sent back for unexpected error on the server. If this error
occurs, the user should retry the same request. If the error continues the user should
verify the server logs.
occurs, the user should retry the same request. If the error continues the user should
verify the server logs.
5.12 Error Responses
In addition to HTTP header status code, the error response contains a content component. The following
table shows error response samples. All the other error responses follow a similar format.
table shows error response samples. All the other error responses follow a similar format.
Table 37 - CSV Request / Error Response Sample – Invalid HTTP Verb
Request / Error Response (CSV) - Invalid HTTP Verb: POST
Request
POST /ppm/rest/reports/ HTTP/1.1
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Host: ppm-clean.cisco.com:4440
User-Agent: RestClient-Tool
Response
HTTP/1.1 405 Method Not Allowed
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2012 16:12:11 GMT
Allow: GET
Content-Type: text/csv;charset=UTF-8
Server: Apache-Coyote/1.1
Cache-Control: no-cache
POST /ppm/rest/reports/ HTTP/1.1
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Host: ppm-clean.cisco.com:4440
User-Agent: RestClient-Tool
Response
HTTP/1.1 405 Method Not Allowed
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2012 16:12:11 GMT
Allow: GET
Content-Type: text/csv;charset=UTF-8
Server: Apache-Coyote/1.1
Cache-Control: no-cache
error_code,error_message
UnsupportedHttpVerb,HTTP method [POST] is not supported.
Table 38 - JSON Request / Error Response Sample - Invalid HTTP Verb
Request / Error Response (Json) – Invalid HTTP Verb: POST
Request – Notice, the Accept header is set for “application/json”.
POST /ppm/rest/reports/ HTTP/1.1
Accept: application/json
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Host: ppm-clean.cisco.com:4440
User-Agent: RestClient-Tool
Response
HTTP/1.1 405 Method Not Allowed
Transfer-Encoding: chunked
Date: Sun, 01 Apr 2012 07:50:28 GMT
Allow: GET
Content-Type: application/json;charset=UTF-8
Server: Apache-Coyote/1.1
Cache-Control: no-cache
POST /ppm/rest/reports/ HTTP/1.1
Accept: application/json
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Host: ppm-clean.cisco.com:4440
User-Agent: RestClient-Tool
Response
HTTP/1.1 405 Method Not Allowed
Transfer-Encoding: chunked
Date: Sun, 01 Apr 2012 07:50:28 GMT
Allow: GET
Content-Type: application/json;charset=UTF-8
Server: Apache-Coyote/1.1
Cache-Control: no-cache
{
"error": {
"error": {