本文整理汇总了TypeScript中@angular/http.Http.patch方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Http.patch方法的具体用法?TypeScript Http.patch怎么用?TypeScript Http.patch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/http.Http
的用法示例。
在下文中一共展示了Http.patch方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: patch
patch(
action: string,
body = '',
headers: { [key: string]: string } = {}
): Observable<any> {
let url: string = environment['api'] + action
headers['Content-Type'] = 'application/json'
let options = new RequestOptions({
headers: new Headers(headers),
})
return this._http
.patch(url, body, options)
.map(this._extract)
.catch(this._handleError)
}
示例2: patch
patch(url: string, body: any, options?: RequestOptionsArgs) {
options = this.getOptions(options);
return this.http.patch(url, body, options);
}
示例3: patch
patch(url: string, body: string, options?: RequestOptions): Observable<Response> {
return this.http.patch(this.url(url), body, this.requestOptions(options));
}
示例4: updateData
private updateData(data_url, data): Promise<any> {
return this.http.patch(data_url, data)
.toPromise()
.then(this.extractData)
.catch(this.handleError);
}
示例5: updateDraft
/**
* Update an existing draft with new information.
* PATCH: /api/drafts/update
*
* @param draft The draft to update.
* @returns {Observable<Draft>} The draft returned from the server.
*/
public updateDraft(draft : Draft) : Observable<Draft> {
return this.http.patch('/api/drafts/update', draft, this.headersWithAuth())
.map(this.parseJson)
.map(this.createDraftModel)
.catch(this.handleError);
}
示例6: patchElement
patchElement(id: string, element: any) {
return this.http.patch(id, element, { headers: this.headers });
}
示例7: update
update(post){
return this.http.patch(this.url+"/"+post.id,JSON.stringify(post))
.catch(this.hanldeError);
}
示例8:
return this.getPostData(url, body, options, (url: string, options: RequestOptionsArgs) => {
return this.http.patch(url, body.options);
});
示例9: Promise
return new Promise((resolve, reject) => {
this.handleRequest(this.http.patch(LoopbackAPI.URL(url, params), JSON.stringify(body), options), resolve, reject);
});
示例10: httpPatch
httpPatch(url: string, body = {}, options = {}) {
return this.http.patch(this.wpApiLoader.getWebServiceUrl(url), body, options);
}