I am new to Angular 9 and facing an issue with headers in my post request. The error message says:
Unnecessarily quoted property 'Authorization' found
. What does this mean? What is it asking for? How can I resolve it?
serviceName.service.ts:
export class DadataSuggestService {
url = 'https://cleaner.dadata.ru/api/v1/clean/name';
token = 'f6bf5c998d0e4fcd58cea3b241763e01fe918127';
secret = 'c6461196cb75f4f880b07f9bf5fb58b7a715b245';
query = 'Срегей владимерович иванов';
constructor(private http: HttpClient) {
}
options: {} = {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Token ' + this.token,
'X-Secret': this.secret
},
body: JSON.stringify([query])
};
takeSuggestion(URL: string, options: object): any {
return this.http.post(URL, options)
.pipe(
tap(
data => console.log(data),
error => console.log(error)
)
);
}
}