mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-31 18:15:20 +00:00
API: HTTP: change response content type to JSON
The HTTP API responses are encoded in json Suggested-by: Samuel Ortiz <sameo@linux.intel.com> Tested-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com> Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
7498647e3f
commit
ede262684d
@ -8,7 +8,7 @@ extern crate threadpool;
|
||||
use crate::api::http_endpoint::{VmActionHandler, VmCreate, VmInfo, VmmShutdown};
|
||||
use crate::api::{ApiRequest, VmAction};
|
||||
use crate::{Error, Result};
|
||||
use micro_http::{HttpConnection, Request, Response, StatusCode, Version};
|
||||
use micro_http::{HttpConnection, MediaType, Request, Response, StatusCode, Version};
|
||||
use std::collections::HashMap;
|
||||
use std::io::{Read, Write};
|
||||
use std::os::unix::net::UnixListener;
|
||||
@ -94,6 +94,7 @@ fn http_serve<T: Read + Write>(
|
||||
};
|
||||
|
||||
response.set_server("Cloud Hypervisor API");
|
||||
response.set_content_type(MediaType::ApplicationJson);
|
||||
http_connection.enqueue_response(response);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user