Advertisement
terabix

HTTPOptions Error

Jun 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. const httpOptions = {
  2. headers: new HttpHeaders({ 'Content-Type': 'application/json'}),
  3. responseType: 'text' as 'text'
  4. };
  5.  
  6. return this.http.post<string>(this.registrationUrl, JSON.stringify(form), httpOptions);
  7.  
  8. ERROR in ../../players/players-register/players-register.service.ts(37,82): error TS2345: Argument of type '{ headers: HttpHeaders; responseType: "text"; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }'.
  9. Types of property 'responseType' are incompatible.
  10. Type '"text"' is not assignable to type '"json"'.
  11. tournaments-create.service.ts(23,74): error TS2345: Argument of type '{ headers: HttpHeaders; responseType: "text"; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }'.
  12. Types of property 'responseType' are incompatible.
  13. Type '"text"' is not assignable to type '"json"'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement