Rat*_*teM 3 angular angular-httpclient
我正在对节点服务器进行 api 调用。这是一个后调用,但我收到错误作为响应,但 firebase 上的数据发生了变化。
const header : HttpHeaders = new HttpHeaders()
header.append('Content-Type', 'application/x-www-form-urlencoded')
this.http.post('http://localhost:3000/s/getKey', { seqKey : 'invoices' }, {
headers : header
}).subscribe(data => {
console.log(data)
})
Run Code Online (Sandbox Code Playgroud)
更新
小智 6
我有同样的问题。我在后端使用 Spring REST API,它只返回一个字符串,这是一个问题,因为 Angular HttpClient 需要 JSON。我通过将 String 包装在一个简单的 POJO 中并返回它来解决这个问题。
| 归档时间: |
|
| 查看次数: |
7032 次 |
| 最近记录: |