diff --git a/nativescript-background-http/background-http.android.ts b/nativescript-background-http/background-http.android.ts index 4f359c0..e29af91 100644 --- a/nativescript-background-http/background-http.android.ts +++ b/nativescript-background-http/background-http.android.ts @@ -186,6 +186,12 @@ class Task extends ObservableBase { } } + var utf8 = options.utf8; + + if (utf8) { + request.setUtf8Charset(); + } + var displayNotificationProgress = typeof options.androidDisplayNotificationProgress === "boolean" ? options.androidDisplayNotificationProgress : true; if (displayNotificationProgress) { request.setNotificationConfig(new (net).gotev.uploadservice.UploadNotificationConfig()); diff --git a/nativescript-background-http/index.d.ts b/nativescript-background-http/index.d.ts index 04643ae..00587d9 100644 --- a/nativescript-background-http/index.d.ts +++ b/nativescript-background-http/index.d.ts @@ -149,6 +149,10 @@ export interface Request { */ description: string; + /** + * Use utf8 encode in requests + */ + utf8?: boolean; /* * Use this to set if progress notification should be displayed or not