Response HTTP Header Optimization
You can optimize the HTTP headers included in the HTTP response. By optimizing the headers, you can get the HTTP response with the minimum set of the HTTP headers.
To optimize the headers, please set the HTTP header kii-m:0
when sending the request.
The header optimization will remove CORS (Cross-Origin Resource Sharing) and cache-related HTTP headers. If you are executing the REST API on the environment that relies on these headers, such as a web application running on a browser, please do not optimize the headers.
Example of response HTTP header optimization
Here is an example. The following example shows the HTTP headers that will be included in the HTTP response when you sign up a user.
HTTP/1.1 201 Created
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Type, Authorization, Content-Length, X-Requested-With, ETag
, X-Step-Count
Age: 0
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/vnd.kii.RegistrationResponse+json;charset=UTF-8
Date: Mon, 13 Jun 2016 03:00:11 GMT
Location: https://api-jp.kii.com/api/apps/{APP_ID}/users/{USER_ID}
Server: nginx
X-HTTP-Status-Code: 201
Content-Length: 231
Connection: keep-alive
{
"userID" : "{USER_ID}",
... (snip) ...
}
The next example shows how the response HTTP headers are optimized by setting the kii-m:0
header upon requesting the user sign-up.
HTTP/1.1 201 Created
Content-Type: application/vnd.kii.RegistrationResponse+json;charset=UTF-8
Date: Mon, 13 Jun 2016 03:00:56 GMT
Server: nginx
Content-Length: 231
Connection: keep-alive
{
"userID" : "{USER_ID}"
... (snip) ...
}