1

我正在使用下面的代码将图像文件发送到 mashape api,但是他们的示例要求我将路径传递给实际文件。

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();

而不是File. 可以使用一个BufferedImage吗?

4

0 回答 0