0

After sending a POST request from my iOS app, I get the below error. The error doesn't seem to have any effect and everything continues to run fine, but I would like to know how to remove the error (as I worry there is something not entirely right which might have negative effects later)? I am wondering it there is some way to close off the POST request and avoid the error.

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: The current iOS code I use is simply

@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()

}

even though I have also tried other versions (especially with more information in the body, which doesn't change anything).

On Heroku, I simply run

app.post("/test", function (req, res) {
    console.log("Test Log")
}

which already creates the described error.

It seems I always get the same error with the POST request, there does not seem to be a problem with GET requests.

AJGronevelt
  • 551
  • 1
  • 6
  • 22
  • what SLA are u on at heroku? pay attention to H12 on heroku. Read about how the timer ( 30 sec default or something ) is implemented between their front-end routers and your dynos and your workers. if you are on their FREE tier, i would want to make very sure that nothing other than their cycles of the dynos ( quiesce/ reawake ) is cause of a 30 sec. latency. – Robert Rowntree Jan 29 '17 at 04:26

1 Answers1

0

Please post your code, I cannot comment this as I have low reputaion.

Request timeouts are due to the server not responding.

Check this post, and see if you have set up the server properly.

If the error persists, try using a get request instead.

Community
  • 1
  • 1