[英]How to pass 3 arguments instead of 2 in Angular 5 HttpClientModule
我试图将3个参数发送到后端路由器
// Function to get user's profile image
getProfileImage(): Observable<Blob>{
this.createAuthenticationHeaders(); // Create headers before sending to API
return this._http.get(this.domain + '/authentication/getProfileImageok', this.options, { responseType: "blob" });
}
但说只能寄两个
不,如果要发送某些参数,则不能按照官方文档发送三个参数,必须将这些参数附加到get请求的第二个参数中。
演示对象-
get(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe?: HttpObserve;
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
withCredentials?: boolean;
} = {}): Observable<any>
有关更多信息,请参见此处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.