本文整理汇总了TypeScript中angular2-jwt.AuthHttp.put方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AuthHttp.put方法的具体用法?TypeScript AuthHttp.put怎么用?TypeScript AuthHttp.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2-jwt.AuthHttp
的用法示例。
在下文中一共展示了AuthHttp.put方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: put
put(url, data) {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
return this._authHttp.put(url, data, {
headers: headers
});
}
示例2: updatePanel
updatePanel(panelId: number, panelDTO: PanelDTO): Observable<Panel> {
let body = JSON.stringify(panelDTO);
let headers = new Headers({'Content-Type': 'application/json'});
let options = new RequestOptions({ headers: headers});
return this.authHttp.put(PAP_API_URL + `/panels/${panelId}`, body, options)
.map(response => response.json())
.catch(this.logAndPassOn);
}
示例3: put
public put(url: string, data: Object, headers: Object = {}): Observable<Response> {
const options = new RequestOptions({ headers: this.headers});
return this.http.put(url, JSON.stringify(data), options)
.map((response: Response) => {
this.authService.saveToken(response);
return response.json() as Response;
})
.catch((error: Response) => {
this.authService.saveToken(error);
this.toastr.error(error);
return Observable.throw(error);
});
}
示例4: putUrl
/**
* Adds the URL of the thumbnail API to the API Call and does a HTTP GET request.
*
* @param apiUrl relative path for the call
* @param data the data which shall be send
* @param headers additional headers
* @returns {Observable<Response>}
*/
public putUrl(apiUrl: string, data: any, headers: object = {}) {
this.setUrl();
return this.authHttp.put(this.thumbnailApiUrl + apiUrl, data, headers);
}
示例5: put
public put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response> {
return this.authIntercept(this.authHttp.put(url, body, options));
}
示例6: putUrl
/**
* Adds the userStoreUrl to the api Call and do a HTTP GET request
* @param apiUrl relative path for the call
* @param data the data which shall be send
* @param headers additional headers
* @returns {Observable<Response>}
*/
public putUrl(apiUrl: string, data: string, headers: any) {
this.setUrl();
return this.http.put(this.userStoreUrl + apiUrl, data, headers);
}
示例7: updateIdentifier
// Delete an identifier from a person
public updateIdentifier(identifier:any):Observable<any> {
console.log('Service update:', identifier);
return this.http.put(
env.apiRoot + '/identifier/'+ identifier.id, identifier
).map(res=>res.json());
}
示例8: update
public update(id:Number, person:any):Observable<any> {
return this.http.put(
env.apiRoot + '/person/' + id, person
).map(res=>res.json());
}
示例9: update
update(company:Company): Promise<Company> {
let headers = new Headers({'Content-Type': 'application/json'});
return this.http.put(this.conf.companyByIdURL(company.id), JSON.stringify(company), {headers: headers})
.toPromise()
.then(response => response.json())
}
示例10: put
public put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response> {
return this.http.put(url, body, options).catch((error) =>
error.status === 401 ?
this.tokenService.mustUpdateToken().flatMap((data: any) => this.put(url, body, options)) :
Observable.throw(error));
}