当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript HttpClient.post方法代码示例

本文整理汇总了TypeScript中@angular/common/http.HttpClient.post方法的典型用法代码示例。如果您正苦于以下问题:TypeScript HttpClient.post方法的具体用法?TypeScript HttpClient.post怎么用?TypeScript HttpClient.post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/common/http.HttpClient的用法示例。


在下文中一共展示了HttpClient.post方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getSearchResults

 getSearchResults(searchTerm) {
   return this.http.post(this.apiURL + 'searchResultsPage.json', {searchTerm});
 }
开发者ID:nascal3,项目名称:AplusSkills-webApp-angular,代码行数:3,代码来源:search.service.ts

示例2:

  public add<T>(itemName: string): Observable<T> {
    const toAdd = JSON.stringify({ ItemName: itemName });

    return this.http.post<T>(this.actionUrl, toAdd);
  }
开发者ID:geogikei,项目名称:INTEXO_PE_WEB,代码行数:5,代码来源:data.service.ts

示例3: create

 create(personId: number, command: ChargeCommand): Observable<ChargeModel> {
   return this.http.post<ChargeModel>(`/api/persons/${personId}/charges`, command);
 }
开发者ID:Ninja-Squad,项目名称:globe42,代码行数:3,代码来源:charge.service.ts

示例4: signup

 signup(credentials: User): Observable<object> {
   return this.http.post('http://localhost:8080/api/users', credentials).pipe(
     mergeMap(res => this.login(credentials))
   );
 }
开发者ID:MatthewYKnowles,项目名称:CodingProjects,代码行数:5,代码来源:auth.service.ts

示例5: addTask

 addTask(name:string,desc:string){
   httpOptions.headers = httpOptions.headers.set('Authorization', window.localStorage['jwt']);
   return this.http.post(url+"task",JSON.stringify({name:name,description:desc}),httpOptions);
 }
开发者ID:florianess,项目名称:wisebatttest,代码行数:4,代码来源:back.service.ts

示例6: addHistory

 addHistory(atletaHistory: AtletaHistory) {
   atletaHistory.codigo = null;
     return this.http.post(`${LUF_API}/atletas/history-new`, atletaHistory);
 }
开发者ID:alexalvesdesouza,项目名称:front_end_projects,代码行数:4,代码来源:atleta.service.ts

示例7: create

 create(personId: number, text: string): Observable<NoteModel> {
   const command = { text };
   return this.http.post<NoteModel>(`/api/persons/${personId}/notes`, command);
 }
开发者ID:Ninja-Squad,项目名称:globe42,代码行数:4,代码来源:person-note.service.ts

示例8: duplicatePlaybook

	/**
	 * Duplicates and saves an existing playbook, it's workflows, actions, branches, etc. under a new name.
	 * @param playbookId ID of the playbook to duplicate
	 * @param newName Name of the new copy to be saved
	 */
	duplicatePlaybook(playbookId: string, newName: string): Promise<Playbook> {
		return this.http.post(`/api/playbooks?source=${playbookId}`, { name: newName })
			.toPromise()
			.then((data) => plainToClass(Playbook, data))
			.catch(this.utils.handleResponseError);
	}
开发者ID:iadgov,项目名称:WALKOFF,代码行数:11,代码来源:playbook.service.ts

示例9: escalate

 public escalate(alerts: Alert[]): Observable<Object | RestError> {
   return this.http.post('/api/v1/alerts/ui/escalate', alerts).pipe(
   catchError(HttpUtil.handleError));
 }
开发者ID:merrimanr,项目名称:incubator-metron,代码行数:4,代码来源:alerts.service.ts

示例10: save

 public save(recipe: Recipe) {
   if (!recipe.id) {
     return this.http.post('/recipes', recipe);
   }
 }
开发者ID:sspringer82,项目名称:FHRO,代码行数:5,代码来源:recipe.service.ts


注:本文中的@angular/common/http.HttpClient.post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。