从我的iOS应用程序发送POST请求后,我收到以下错误。该错误似乎没有任何影响,一切都继续运行正常,但我想知道如何删除错误(因为我担心有一些不完全正确,可能会产生负面影响)?我想知道有一些方法可以关闭POST请求并避免错误。
at=error code=H12 desc="Request timeout" method=POST path="/test" host=my-server.herokuapp.com request_id=fea9cffc-5e67-4301-baaa-d2fd18cfd0ea fwd="95.147.171.193" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0
PS:我使用的当前iOS代码只是
@IBAction func Test(_ sender: Any) {
let url = NSURL(string: "https://my-server.herokuapp.com/test")!
let request = NSMutableURLRequest(url: url as URL)
request.httpMethod = "POST"
URLSession.shared.dataTask(with: request as URLRequest) { (data, response, error) -> Void in
// TODO: Handle errors
}.resume()
}
即使我也尝试了其他版本(特别是在正文中有更多信息,但不会改变任何内容)。
在Heroku上,我只是运行
app.post("/test", function (req, res) {
console.log("Test Log")
}
已经产生了所描述的错误。
似乎我总是在POST请求中遇到相同的错误,GET请求似乎没有问题。
答案 0 :(得分:0)