Last active
June 5, 2019 10:33
-
-
Save BnayaZil/eb79e23dc8c4238027a6b115a76c373c to your computer and use it in GitHub Desktop.
Get request using Angular httpClient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://localhost:8080/GetPlayers?playerID=IHS | |
const params = new HttpParams().set('playerID',playerid) | |
const headers = new HttpHeaders({ | |
'Content-Type': 'application/json'}) | |
return this.http.get<{message: string, player : Player}>(`http://localhost:8080/GetPlayers`, {params, headers}).subscribe( | |
(res) => console.log(res), | |
(err) => console.error(err) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment