Send BufferedImage instead of File in unirest

134 views Asked by At

I'm using the code below to send an image file to mashape api, however their example requires that I pass a path to an actual file.

HttpResponse<JsonNode> response = Unirest.post("https://apicloud-facerect.p.mashape.com/process-file.json")
.header("X-Mashape-Key", "MYKEY")
.header("X-Mashape-Host", "apicloud-facerect.p.mashape.com")
.field("image", new File("[object Object]"))
.field("features", )
.asJson();

Instead of File. Is it possible to use a BufferedImage?

0

There are 0 answers