File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
1313
1414 var context = require ( "Application/application" ) . Application . current . android . context ;
1515
16- if ( isImage ) {
16+ if ( isImage && options . method && options . method . toLowerCase ( ) == "get" ) {
1717 var request = com . koushikdutta . ion . Ion . with ( context , options . url ) ;
1818 request . asBitmap ( ) . setCallback ( new com . koushikdutta . async . future . FutureCallback ( {
1919 onCompleted : function ( error , data ) {
@@ -41,7 +41,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
4141 if ( options . headers ) {
4242 for ( var key in options . headers ) {
4343 request . addHeader ( key , options . headers [ key ] )
44- }
44+ }
4545 }
4646
4747 if ( typeof options . timeout == "number" ) {
@@ -74,11 +74,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
7474 toString : ( ) => { return result } ,
7575 toJSON : ( ) => { return JSON . parse ( result ) } ,
7676 toImage : ( ) => {
77- var imageAsBytes = new java . lang . String ( result ) . getBytes ( ) ;
78- var bmp = android . graphics . BitmapFactory . decodeByteArray ( imageAsBytes , 0 , imageAsBytes . length ) ;
79- // TODO: Implement this!
80- //return null;
81- return require ( "Image/image" ) . Image . imageFromNativeBitmap ( bmp ) ;
77+ return null ;
8278 }
8379 } ,
8480 statusCode : rawHeaders . getResponseCode ( ) ,
You can’t perform that action at this time.
0 commit comments