Connection header always keep-alive
Hi there,
The requests being generated appear to be always sent with a header Connection:keep-alive. I tried explicitly adding a header Connection:close but this is being ignored.
Any suggestions would be appreciated.
Thanks
Tim
Hmm good catch. It must have something to do with the Cocoa URL connection implementation. I managed to find a thread from 2005 referencing this very situation (http://lists.apple.com/archives/macnetworkprog/2005/Oct/msg00030.html) but in the spirit of the pre-StackOverflow internet, I don't see an answer. I'll investigate more...
I experienced the same result. In addition, The "Connection: keep-alive" doesn't appear in the "Sent Headers" tab.
According to some the answer is setting request.setValue("close", forKey: "Connection")
https://stackoverflow.com/questions/35441584/how-can-i-add-the-http-header-connection-close-correctly-in-swift However, there is mention of that 2005 thread.
"Accept: /" header is also sent -- but it can be overridden and does show in the "Sent Headers" tab.
I like the cut and paste curl command. Nice project overall.
Thanks, you're inspiring me to take another look at this.