Http 错误:";标题“;选项必须是字典样式

Http 错误:";标题“;选项必须是字典样式,http,ionic-framework,ionic-native,cordova-plugin-advanced-http,ionic-native-http,Http,Ionic Framework,Ionic Native,Cordova Plugin Advanced Http,Ionic Native Http,我正在尝试从后端获取blob图像,并且在ionic 4应用程序中使用本机HTTP 实施情况如下: import { HTTP } from '@ionic-native/http/ngx'; constructor(private nativeHttp: HTTP) {} getAttachmentWithNativeHttp(url: string, parameters?: any): Observable<any> { url = url + this.common

我正在尝试从后端获取
blob
图像,并且在ionic 4应用程序中使用
本机HTTP

实施情况如下:

import { HTTP } from '@ionic-native/http/ngx';

constructor(private nativeHttp: HTTP) {}

getAttachmentWithNativeHttp(url: string, parameters?: any): Observable<any> {
    url = url + this.commonService.getQueryString(parameters);
    var headers = this.getHeaders('GET', url);
    this.nativeHttp.clearCookies();
    this.nativeHttp.setServerTrustMode('nocheck');
    const reqOptions: any = {
      method: 'get',
      responseType: 'blob' as 'blob',
      headers: headers
    }
    return from(this.nativeHttp.sendRequest(url, reqOptions)).pipe(
      finalize(() => { if (toIntercept) this.setProgressDialogVisibility(false) })
    )
  }
从'@ionic native/HTTP/ngx'导入{HTTP};
构造函数(私有nativeHttp:HTTP){}
getAttachmentWithNativeHttp(url:string,参数?:any):可观察

sendRequest()
允许我传递
responseType
参数。我还尝试使用
get()
,但每当我进行请求调用时,都会出现以下错误:


我缺少带有
标题的内容
,或者我是否需要以另一种方式发送
响应类型
,以获取blob图像?

这不是正确的方法,但是params=JSON.parse(JSON.stringify(params))解除了我的阻止。可能是一个错误,但这不是正确的方法,但是params=JSON.parse(JSON.stringify(params))解除了我的阻碍。可能是个虫子