use of de.cinovo.cloudconductor.api.lib.exceptions.SerializationException in project cloudconductor-agent-redhat by cinovo.
the class AbstractApiHandler method request.
protected final HTTPRequest request(String path, Object obj, JavaType type) throws SerializationException {
try {
ObjectWriter bodyWriter = AbstractApiHandler.mapper.writer();
if ((type != null) && ((obj instanceof Set) || (obj instanceof List))) {
bodyWriter = bodyWriter.forType(type);
}
String body = bodyWriter.writeValueAsString(obj);
return this.request(path).body(body).header("Content-Type", MediaType.APPLICATION_JSON);
} catch (IOException e) {
throw new SerializationException();
}
}
Aggregations