Ошибка CORS policy Angular
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
response: any
constructor(
private http: HttpClient
) { }
ngOnInit(): void {
this.http.get('https://business.tinkoff.ru/openapi/sandbox/api/v1/bank-statement',
{headers: new HttpHeaders()
.set("Authorization", "Bearer TinkoffOpenApiSandboxSecretToken"),
},
)
.subscribe((response)=>{
this.response = response
console.log(this.response);
})
}
}
В консоли получаю ошибку:
Access to XMLHttpRequest at 'https://business.tinkoff.ru/openapi/sandbox/api/v1/bank-statement' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Как решить проблему?