Skip to content

Instantly share code, notes, and snippets.

@fexx
Created October 19, 2019 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fexx/5ccf01c18932ee6a33f556c8d48b46a1 to your computer and use it in GitHub Desktop.
Save fexx/5ccf01c18932ee6a33f556c8d48b46a1 to your computer and use it in GitHub Desktop.
Métodos http Consumindo API REST com HttpClient no Angular 8)
this.httpClient.get<Car[]>(this.url)
this.httpClient.post<Car>(this.url, JSON.stringify(car), this.httpOptions)
this.httpClient.put<Car>(this.url + '/' + car.id, JSON.stringify(car), this.httpOptions)
this.httpClient.delete<Car>(this.url + '/' + car.id, this.httpOptions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment