我不知道如何使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