我正在尝试使用get'get'请求,但由于包含外部表单的kendo UI网格正在使用JSONP而无法执行
Kendo用户界面代码:-
private fetch(action: string = '', data?: any): Observable<any[]> {
return this.http
.jsonp(`https://demos.telerik.com/kendo-ui/service/Products/${action}?${this.serializeModels(data)}`, 'callback')
.pipe(map(res => <any[]>res));
}
我想使用这个:-
private fetch(action: string = '', data?: any): Observable<any[]> {
return this.http
.get(`https://jsonplaceholder.typicode.com/posts/${action}?${this.serializeModels(data)}`, httpOptions)
.pipe(map(res => <any[]>res));
}
这给了我错误