How to POST InputStream as the body of a request in Retrofit?

前端 未结 5 642
刺人心
刺人心 2021-01-18 00:52

I\'m attempting to do a POST with the body being an InputStream with something like this:

@POST(\"/build\")
@Headers(\"Content-Type: application/tar\")
Respo         


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 01:00

    According to the Multipart section of http://square.github.io/retrofit/ you'll want to use TypedOutput instead of TypedInput. Following their examples for multipart uploads worked fine for me once I had implemented a TypedOutput class.

提交回复
热议问题