我不知道如何使API调用这样的方法:Angular,Http GET参数?
[HttpGet]
[ActionName("GetSupport")]
public HttpResponseMessage GetSupport(int projectid)
因为它是GET,但仍然有一个参数来传递,如何做到这一点? 会是这样的吗?
let headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('projectid', this.id);
this.http.get('http://localhost:63203/api/CallCenter/GetSupport', { headers: headers })
的可能的复制[如何URL参数(查询字符串)传递给角2上的HTTP请求(https://stackoverflow.com/questions/ 34475523/how-to-pass-url-arguments-query-string-to-a-http-request-on-angular-2) – anoop