Angular 4 HttpClient Query Parameters

后端 未结 8 967
耶瑟儿~
耶瑟儿~ 2020-11-29 16:00

I have been looking for a way to pass query parameters into an API call with the new HttpClientModule\'s HttpClient and have yet to find a solution

8条回答
  •  执笔经年
    2020-11-29 16:42

    A more concise solution:

    this._Http.get(`${API_URL}/api/v1/data/logs`, { 
        params: {
          logNamespace: logNamespace
        } 
     })
    

提交回复
热议问题