Here's where I am so far with NSURLSessionUploadTask
:
- iOS application starts an
NSURLSessionUploadTask
using POST - server receives HTTP POST request
- server reads content of the request so data is uploaded
- iOS application calls
URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:
repeatedly ending with a final call withtotalBytesSent
equal tototalBytesExpectedToSend
- server sends HTTP response to iOS consisting of the following:
HTTP/1.1 200 OK Server: BaseHTTP/0.3 Python/2.7.10 Date: Fri, 30 Oct 2015 16:15:21 GMT Content-Type: text/html <html><head><title>POST RESPONSE</title></head><body><p>The file was uploaded.</p></body></html>
- iOS application receives this response (confirmed via Wireshark)
- iOS application does not call the following methods to complete the upload task like it supposed to:
NSURLSessionTaskDelegate: -> URLSession:dataTask:didReceiveData:
NSURLSessionTaskDelegate -> URLSession:task:didCompleteWithError:
- instead after hanging for ~200 seconds, the iOS application repeats the data upload task
This data upload, HTTP 200 response, ~200 second hang process appears to repeat indefinitely. Why aren't NSURLSessionTaskDelegate: -> URLSession:dataTask:didReceiveData:
and NSURLSessionTaskDelegate -> URLSession:task:didCompleteWithError:
being called once the HTTP response is received by the iOS application?