|
@@ -75,6 +75,7 @@ public class RNFetchBlobBody extends RequestBody{
|
75
|
75
|
break;
|
76
|
76
|
case AsIs:
|
77
|
77
|
contentLength = this.rawBody.getBytes().length;
|
|
78
|
+ requestStream = new ByteArrayInputStream(this.rawBody.getBytes());
|
78
|
79
|
break;
|
79
|
80
|
case Others:
|
80
|
81
|
break;
|
|
@@ -117,10 +118,7 @@ public class RNFetchBlobBody extends RequestBody{
|
117
|
118
|
@Override
|
118
|
119
|
public void writeTo(BufferedSink sink) {
|
119
|
120
|
try {
|
120
|
|
- if (requestType == RNFetchBlobReq.RequestType.AsIs)
|
121
|
|
- sink.write(rawBody.getBytes());
|
122
|
|
- else
|
123
|
|
- pipeStreamToSink(requestStream, sink);
|
|
121
|
+ pipeStreamToSink(requestStream, sink);
|
124
|
122
|
} catch(Exception ex) {
|
125
|
123
|
RNFetchBlobUtils.emitWarningEvent(ex.getLocalizedMessage());
|
126
|
124
|
ex.printStackTrace();
|