Tag: 改造

如何将InputStream作为Retrofit中的请求主体进行POST?

我正在尝试做一个身体是一个InputStream类似这样的POST: @POST("/build") @Headers("Content-Type: application/tar") Response build(@Query("t") String tag, @Query("q") boolean quiet, @Query("nocache") boolean nocache, @Body TypedInput inputStream); 在这种情况下,InputStream来自压缩的tar文件。 发布InputStream的正确方法是什么?