angular4 httpclient怎么传递头信息
var params = `username=${data.username}&sign=${data.sign}×tamp=${data.timestamp}`
// console.log(httpParams.keys())
var headers = new HttpHeaders()
.append('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8')
.append('key','jinglicloud2017')
console.log(headers.get('key'))
console.log(headers);
return this.http.post(
`https://l.jingli365.com/cloud/api/v1/auth/login`,
params,
{
headers:headers,
})
我要把key作为头信息传递给后台,作为认证信息,但是传不过去,不知道原因