HTTP messages
This documentation describes and presents examples of API requests in terms of the standard HTTP message transmission format. Using this format keeps the examples language independent and provides a standard notation for expressing the message content.
In practice, you create, send, and receive HTTP messages by using APIs supplied by an HTTP client library specific to your chosen programming language.
HTTP requests
HTTP request messages consist of a request line, header lines, a blank line, and a message body. The request line contains the HTTP method, the URI of an API, and the HTTP protocol version. Header lines consist of a header name followed by a colon and the corresponding value (for a list of headers, see common request headers). The message body is a JSON document.
The following example shows an HTTP request that would search for all of the pods in a cloud:
POST csm/Pod/search HTTP/1.1
Host: cloud.calbro.com
Authentication-Token: yourAuthenticationToken
{"timeout" : -1}
HTTP responses
HTTP response messages consist of a status line, header lines, a blank line, and a message body. The status line contains the HTTP protocol version, a numeric response code that indicates success or failure of the request, and a textual description of the response code. Header lines consist of a header name followed by a colon and the corresponding value (see common response headers for a list of headers).The message body is a JSON document.
The following example shows an HTTP response to a request to search for all of the pods in a cloud:
HTTP/1.1 200 OK
Date: Tue, 01 Feb 2011 21:39:12 GMT
BMC-Transaction-ID: fbbdc97f-89f3-4ec3-9911-9e156e9f87f5
Content-Type: application/json; charset=UTF-8
Content-Length: 978
Server:Jetty(6.1.9)
[{
"cloudClass" : "com.bmc.cloud.model.beans.SearchResults",
"guid" : "13e716aa-c4f8-4e80-9044-47603aab75a1",
"pageNo" : 0,
"pageSize" : -1,
"results" : [ {
"cloudClass" : "com.bmc.cloud.model.beans.Pod",
"containerBlueprints" :
[ "/containerblueprint/7aba0736-2684-41de-9da8-d715067c6aaa",
"/containerblueprint/9aba0736-2684-41de-9da8-d715067c6bbb" ],
"containers" : [ "/networkcontainer/ff5080d6-e9f2-4dcc-847a-eafa5e2508b0" ],
"externalID" : "392d97a1-efec-423c-a99d-848e1fe1ac35:Austin Pod",
"guid" : "aae0c1b4-c391-4b58-8a36-654fdf2545e6",
"isOnboarded" : true,
"location" : "/location/c3ea7c30-2b2c-4db9-90bf-bd7ff9e95888",
"name" : "Austin Pod",
"provider" : "/provider/392d97a1-efec-423c-a99d-848e1fe1ac35",
"reconciliationID" : "OI-66cfe9b940c240fda9986bee8cdec900",
"staticPools" : [ "/staticpool/6687a3d3-8b4f-466c-a1e7-8e0f71964bc6" ],
"tokenID" : "Austin Pod"
} ],
"totalRows" : 1
}]
Related topics
HTTP-request-and-response-headers
Elements-of-JSON-documents
Common-patterns-in-JSON-documents