mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +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);
|
constructor(source: string);
|
||||||
static extends(source: any);
|
static extends(source: any);
|
||||||
}
|
}
|
||||||
export class UrlEncodedFormBody {
|
|
||||||
constructor(source: any);
|
|
||||||
}
|
|
||||||
export class StreamBody {
|
export class StreamBody {
|
||||||
constructor(source: java.io.InputStream, length: number);
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
request.setBody(new stringBody(options.content));
|
request.setBody(new stringBody(options.content));
|
||||||
}
|
}
|
||||||
else {
|
else if (typeof options.content !== "undefined") {
|
||||||
// TODO: How to transfer everything else?
|
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({
|
var callback = new com.koushikdutta.async.http.callback.HttpConnectCallback({
|
||||||
|
Reference in New Issue
Block a user