gpt4 book ai didi

angular - 获取 Error OK 作为来自 http post 的响应

转载 作者:行者123 更新时间:2023-12-04 10:59:45 27 4
gpt4 key购买 nike

我正在对节点服务器进行 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)
})

更新

Error Image

最佳答案

我遇到了同样的问题。我在后端使用 Spring REST API,它只返回一个字符串,这是一个问题,因为 Angular HttpClient 需要 JSON。我通过将我的字符串包装在一个简单的 POJO 中并返回它来解决它。

关于angular - 获取 Error OK 作为来自 http post 的响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58897854/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com