本文整理匯總了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);
}