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
My solution was to implement TypedOutput
public class TypedStream implements TypedOutput{
private Uri uri;
public TypedStream(Uri uri){
this.uri = uri;
}
@Override
public String fileName() {
return null;
}
@Override
public String mimeType() {
return getContentResolver().getType(uri);
}
@Override
public long length() {
return -1;
}
@Override
public void writeTo(OutputStream out) throws IOException {
Utils.copyStream(getContentResolver().openInputStream(uri), out);
}
}