angular http request query params
request(query) {
let params = new HttpParams().set("keyword", query);
return this.http.get(`Your_URL`, {params});
}
angular http request query params
request(query) {
let params = new HttpParams().set("keyword", query);
return this.http.get(`Your_URL`, {params});
}
How to create and access angular HTTP params in PHP
//Crreating HTTP params
//e.g. http://localhost/api/something.php?title=value&content=value
let httpParams = new HttpParams()
.set('title', this.createNewForm.controls['title'].value)
.set('content', this.createNewForm.controls['content'].value);
//Then pass the Http params object to the http.get) method
this.http.get('http://localhost/api/something.php', {httpParams}).then();
//Accessing these parameters in PHP
$title = $_GET['title'];
$title = $_GET['content'];
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us