각 파일 업 로더는 방법에 대한 http 요청

0

질문

내가 사용하려고 각-파일 업 로더와 파일을 업로드. 에 afuConfig,내가 원하는 설정하는 방법을 게시 하지만 터미널에서 내가 오류가 있습니다.

uploadAPI:  {
      url:"https://example-file-upload-api",
      method:"POST",
      headers: {
     "Content-Type" : "text/plain;charset=UTF-8",
      },
}

그것은 나에게 이:

  The types of 'uploadAPI.responseType' are incompatible between these types.
    Type 'string' is not assignable to type '"blob" | "json" | "arraybuffer" | "text" | undefined'.

나는 같은 문제에 대한 사용 responseType too.

angular file-upload javascript
2021-11-23 11:08:32
2

최고의 응답

2

기본 responseTypejson. 하려고 할당 responseType: text 명시적으로

uploadAPI: {  
  url: "https://example-file-upload-api",
  method:"POST",
  headers: {
    "Content-Type" : "text/plain;charset=UTF-8",
  },
  responseType: 'text'
}
2021-11-23 11:14:13

그것은 작동하지 않았습니다.내 생각,그것은 타이프 라이터 오류가 모르겠지만 그것을 해결하는 방법
mary
0

려고 아래 코드는 위한 headers:

httpOptions: {
  headers:{
    accept: 'application/pdf'
  }
  responseType: 'blob',
}
2021-11-23 11:48:19

그것은 작동하지 않는 나를 위해,그것은 더 타이프 라이터의 오류
mary

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................