2

Hi i am sending blob file to with httpclient and getting 599 status code please help

this.http.post("url",blobfile,{headers:'content-type':'image/jpeg'}).subscribe(r=>{
console.log(r)
})

getting 599 error this works fine on webview but doesn't work on native android device as i am using ionic-native-http-connection-backend and included this in app.module.ts

providers:[{ provide: HttpBackend, useClass: NativeHttpFallback, deps: [Platform, NativeHttpBackend, HttpXhrBackend] }]

i am using ionic 6 can anyone help me with this?

sai kiran
  • 389
  • 2
  • 10
  • Have you tried this solution ? https://github.com/sneas/ionic-native-http-connection-backend/issues/15#issuecomment-383997564 – Cubix48 Feb 26 '22 at 08:41
  • Hi getting status code 0 and remaining urls stopped working geting cors issue – sai kiran Feb 26 '22 at 09:41

1 Answers1

0

use this in app.module.ts resolves the issue

{
provide: HttpBackend, useFactory:
 (platform: Platform, nativeHttpBackend: NativeHttpBackend, httpXhrBackend: HttpXhrBackend) = {
          if (platform.is('android')) {
            return httpXhrBackend;
          } else {
            return new NativeHttpFallback(platform, nativeHttpBackend, httpXhrBackend);
          }
  }, deps: [Platform, NativeHttpBackend, HttpXhrBackend]
}

this resolves 599 issue

sai kiran
  • 389
  • 2
  • 10