mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
binary content post for android
This commit is contained in:
4
declarations.android.d.ts
vendored
4
declarations.android.d.ts
vendored
@ -405,11 +405,9 @@ declare module com {
|
||||
constructor(source: string);
|
||||
static extends(source: any);
|
||||
}
|
||||
export class UrlEncodedFormBody {
|
||||
constructor(source: any);
|
||||
}
|
||||
export class StreamBody {
|
||||
constructor(source: java.io.InputStream, length: number);
|
||||
static extends(source: any);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,11 +28,15 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
request.setBody(new stringBody(options.content));
|
||||
}
|
||||
else {
|
||||
// TODO: How to transfer everything else?
|
||||
else if (typeof options.content !== "undefined") {
|
||||
var streamBody = com.koushikdutta.async.http.body.StreamBody.extends({
|
||||
getContentType: function () {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
request.setBody(new com.koushikdutta.async.http.body.StreamBody(new java.io.ByteArrayInputStream(options.content), options.content.length));
|
||||
}
|
||||
|
||||
var callback = new com.koushikdutta.async.http.callback.HttpConnectCallback({
|
||||
|
Reference in New Issue
Block a user