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


TypeScript Http.head方法代码示例

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


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

示例1: createRequest

 private createRequest(type: string,data ?: Object) : Observable<any> {
   let _url : string = this.buildUrl(data);
   let _request : Observable<any>
   let stringParam : string = '';
   let _jsonBuild : any = {}
   if(_url.split('?')[1] && _url.split('?')[1].length) {
     (_url.split('?')[1].split('&')).forEach( _paramPart => {
       _jsonBuild[_paramPart.split('=')[0]] = _paramPart.split('=')[1];
     });
     stringParam = JSON.stringify(_jsonBuild);
   }
   switch (type) {
     case "post":
       _request = this._http.post(_url.split('?')[0], stringParam);
       break;
     case "patch":
       _request = this._http.patch(_url.split('?')[0], stringParam);
       break;
     case "put":
       _request = this._http.put(_url.split('?')[0], stringParam);
       break;
     case "delete":
       _request = this._http.delete(_url);
       break;
     case "head":
       _request = this._http.head(_url);
       break;
     default:
       _request = this._http.get(_url);
       break;
   }
   this._request = _request.map((response: Response) => response.json());
   return this._request;
 }
开发者ID:nino-c,项目名称:ng2-resource,代码行数:34,代码来源:index.ts

示例2: head

 public head(url: string, paramMap?: any): Observable<Response> {
   return this.http.head(url, new RequestOptions({
     search: HttpService.buildURLSearchParams(paramMap),
     headers: new Headers({
       'token': this.globalData.token
     })
   }));
 }
开发者ID:srayaa,项目名称:ionic3_angular4_JD,代码行数:8,代码来源:HttpService.ts

示例3: head

	head(endpoint: string, options?: RequestOptionsArgs) : Observable<Response>{
		let url = this.getUrl(endpoint);

		return this.http.head(url, options);
	}
开发者ID:jadjoubran,项目名称:angular2-fluent-http,代码行数:5,代码来源:fluent.service.ts

示例4:

 return this.getData(url, options, (url: string, options: RequestOptionsArgs) => {
     return this.http.head(url, options);
 });
开发者ID:oneuptim,项目名称:node-amazon,代码行数:3,代码来源:transfer-http.ts

示例5: checkProjectExists

 checkProjectExists(projectName: string): Observable<any> {
   return this.http
              .head(`/api/projects/?project_name=${projectName}`)
              .map(response=>response.status)
              .catch(error=>Observable.throw(error));
 }
开发者ID:int32bit,项目名称:harbor,代码行数:6,代码来源:project.service.ts

示例6: head

 head(url: string, options?: RequestOptionsArgs): Observable<Response> {
   return this.http.head(url, this.attachAuthHeaders(options));
 }
开发者ID:madhusudhand,项目名称:angular2-cli,代码行数:3,代码来源:httpclient.ts

示例7: head

 head(url: string, options?: RequestOptionsArgs): Observable<Response> {
     return this.http.head(url, this.appendHeaders(options))
         .catch((error) => {return this.handleError(error); });
 }
开发者ID:redrick-tmn,项目名称:SimpleAngularBlogApp,代码行数:4,代码来源:auth-http.service.ts

示例8: httpHead

 httpHead(url: string, options = {}) {
   return this.http.head(this.getFullUrl(url), options);
 }
开发者ID:alpineio,项目名称:wp-api-angular,代码行数:3,代码来源:Parent.ts

示例9: head

 public head(url: string, options?: RequestOptionsArgs) {
   if (this.networkService.noConnection()) {
     this.networkService.showNetworkAlert();
   } else { return this.http.head(url, options) }
 }
开发者ID:davidkirolos,项目名称:RolApp,代码行数:5,代码来源:network-service.ts

示例10: Promise

 return new Promise((resolve, reject) => {
   this.handleRequest(this.http.head(LoopbackAPI.URL(url, params)), resolve, reject);
 });
开发者ID:baijiadu,项目名称:auktionator,代码行数:3,代码来源:loopback-api.ts


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