Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Use of HTTP.DELETE is wrong in Tutorial  #1800

Closed
@fcalderon

Description

@fcalderon

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

In the Tutorial -> HTTP Docs, in the HTTP.DELETE section, the headers are passed the wrong way to the http.delete method:

  delete(hero: Hero) {
    let headers = new Headers();
    headers.append('Content-Type', 'application/json');
    let url = `${this.heroesUrl}/${hero.id}`;
    return this.http
               .delete(url, headers) // <- HERE
               .toPromise()
               .catch(this.handleError);
  }

Expected/desired behavior

  delete(hero: Hero) {
    let headers = new Headers();
    headers.append('Content-Type', 'application/json');
    let url = `${this.heroesUrl}/${hero.id}`;
    return this.http
               .delete(url, { headers : headers }) // <- HERE
               .toPromise()
               .catch(this.handleError);
  }

Note this issue was previously opened in: Angular

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions