0

I have a NSURLConnectionDataTask created by the shared NSURLSession via dataTaskWithRequest. I resume() it, but the completion handler never gets called. Observations:

  • Sending the same request using NSURLConnection’s sendSynchronousRequest works fine.
  • Trying a plain GET URL for the data task works fine with the same code.
  • When I log the state of the data task, I see that bytes are sent, but no bytes are ever received. Both error and response are nil. The state of the task is running.

What am I doing wrong?

4

1 回答 1

0

我忘记将 HTTP 方法设置为POST. GET带有非空正文的请求显然会这样停止。

于 2016-01-06T09:20:11.327 回答