Skip to content

Instantly share code, notes, and snippets.

@PyroGenesis
Last active May 19, 2019 11:11
Show Gist options
  • Save PyroGenesis/b930283fe1316b7ed37ae0387fe40369 to your computer and use it in GitHub Desktop.
Save PyroGenesis/b930283fe1316b7ed37ae0387fe40369 to your computer and use it in GitHub Desktop.
Angular request with Parameters
// GET request with params
GET_with_params(): Observable<any> {
const URL = 'YOUR_URL_HERE';
const params = new HttpParams()
.set('param_key', 'param_value')
.set('param_key2', 'param_value2');
return this.httpClient.get(URL, { params: params }); // returns an Observable
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment