Skip to content

Commit

Permalink
Send bytestring
Browse files Browse the repository at this point in the history
  • Loading branch information
Teagan42 authored and seldondev committed Apr 2, 2020
1 parent 61047a5 commit c4952ee
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,7 @@ public ResponseEntity<String> predictions_binary(RequestEntity<InputStream> requ
tracer.scopeManager().activate(tracingSpan);
}
try {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> protoBody = new HashMap<String, Object>() {{
put("binData", ByteString.copyFrom(toByteArray(requestEntity.getBody())));
}};
return _predictions(mapper.writeValueAsString(protoBody));
return _predictions(toByteArray(requestEntity.getBody()));
} catch (IOException e) {
logger.error("Bad request", e);
throw new APIException(ApiExceptionType.REQUEST_IO_EXCEPTION, e.getMessage());
Expand Down

0 comments on commit c4952ee

Please sign in to comment.