if (entity == null) {
throw new ApitraryOrmException("Cannot persist null entity");
}
log.debug("Saving " + entity.getClass());
PostRequest request = new PostRequest();
request.setEntity(resolveApitraryEntity(entity));
String payload = marshall(entity);
request.setRequestPayload(payload);
PostResponse response = resolveApitraryClient().send(request);
if (HttpStatus.Created.ordinal() == response.getStatusCode()) {
return (T) new PostResponseUnmarshaller().unMarshall(response, entity);