How to make get request by passing parameters? I tried this but getting 404 error
getOrderbyOrderNo() {
this.orderno = this.cookie_service.get('key');
let headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('orderno', this.orderno );
let params = new URLSearchParams();
params.append("someParamKey", this.orderno )
return this.http.get('http://localhost:8080/View/orders', { headers: headers, params: params })
}
output
ERROR
Object { _body: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /View/orders</pre>\n</body>\n</html>\n", status: 404, ok: false, statusText: "Not Found", headers: {…}, type: 2, url: "http://localhost:8080/View/orders" }