當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。