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


TypeScript http.Headers类代码示例

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


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

示例1: headers

 private get headers() : any {
   const headers = new Headers();
   headers.append('x-xsrf-token', JsonService.token);
   return new RequestOptions({'headers' : headers});
 }
开发者ID:PedalPi,项目名称:Apk,代码行数:5,代码来源:rest.ts

示例2: getAuthorizationHeaders

 private getAuthorizationHeaders(): Headers{
     let headers = new Headers();
     headers.append("Authorization", "Bearer " + Config.token);
     headers.append("Content-Type", "application/json");
     return headers;
 }
开发者ID:DarriusWrightGD,项目名称:learning-nativescript,代码行数:6,代码来源:grocery-list.service.ts

示例3: postFile1

   public postFile1(data?: any) {
     let newHeader = new Headers();
     newHeader.append("Authorization", "JWT " + this._authen.getAccessTokenUser().access_token);
     return this._http.post(SystemConstants.BASE_URL + SystemConstants.urls.upload_image.upload_image , data, { headers: newHeader })
         .map(this.extractData);
 }
开发者ID:luuthi,项目名称:mysurvey,代码行数:6,代码来源:upload.service.ts

示例4: login

 login(username: string, password: string): Promise<any> {
   const headers = new Headers();
   headers.append('Content-Type','text/plain');
   return this.pg.postP('users/checkLogin/'+username + "/" + password, {}, headers)
 }
开发者ID:nguyennhutkhanh,项目名称:callcenter,代码行数:5,代码来源:login.service.ts

示例5: Headers

import { Headers } from '@angular/http';

export const contentHeaders = new Headers();
contentHeaders.append('Accept', 'application/json');
contentHeaders.append('Content-Type', 'application/json');
contentHeaders.append('Access-Control-Allow-Origin', '*');
开发者ID:dfarme3,项目名称:dockerdev,代码行数:6,代码来源:contentheaders.ts

示例6: login

 login(details) {
     let headers = new Headers;
     headers.append('Content-Type', 'application/json');
     return this.http.post('http://127.0.0.1:5000/Authenticate',details)
     .map(res=>res.json())
 } 
开发者ID:troplr,项目名称:swift-wallet,代码行数:6,代码来源:api.service.ts

示例7: save

 save(todo) {
   var headers = new Headers();
   headers.append('Content-Type', 'application/json');
   return this.http.post('/api/v1/todo', JSON.stringify(todo), {headers: headers})
     .map(res => res.json());
 }
开发者ID:Codenator81,项目名称:ng2do-mean-app,代码行数:6,代码来源:todo.service.ts

示例8: setAuthorizationHeader

 /**
  * This method appends the authorization header to the request
  * @param {Headers} headers Headers object to fill with the Authorization token
  * @return {Headers} Returns the headers object
  */
 public setAuthorizationHeader(headers: Headers, idUser: string): Headers {
   headers.append(AppConfig.AUTH_HEADER, idUser);
   return headers;
 }
开发者ID:classpip,项目名称:classpip-dashboard,代码行数:9,代码来源:utils.service.ts

示例9: getHeaders

 private getHeaders(contentType?: string): Headers {
     var headers = new Headers();
     headers.append('Content-Type', 'application/json');
     return headers;
 }
开发者ID:CreativeBrandon,项目名称:Angular2-Lumen,代码行数:5,代码来源:custom.exception-handler.ts

示例10:

 delete_folder(id:number){
     this.headers.delete("Authorization");
     this.headers.delete("Content-Type");
     this.headers.append("Authorization", "JWT " + this._authen.getAccessTokenUser().access_token);
     return this._http.delete(SystemConstants.BASE_URL + SystemConstants.urls.folder.get_update_delete  + id, { headers: this.headers }).map(this.extractData);
 }
开发者ID:luuthi,项目名称:mysurvey,代码行数:6,代码来源:folder.service.ts


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