0

I use:

[header setValue:@"Close" forKey:@"Connection"];

to change the headerField, but it's not working. The header always in Connection:keep-alive, how can I change it?

Thanos
  • 2,472
  • 1
  • 16
  • 33
Liuonion
  • 1
  • 1
  • Please check: http://stackoverflow.com/questions/4809047/nsurlrequest-setting-the-http-header –  May 03 '16 at 09:26
  • [request setValue:@"Close" forHTTPHeaderField:@"Connection"]; can,t change the "Connection" field – Liuonion May 03 '16 at 09:35
  • The Connection header is normally set automatically by the URL Loading System. The documentation says not to modify it, and there's no guarantee that changing it in a mutable URL request will have any effect. What problem are you actually trying to solve? – dgatwood May 10 '16 at 06:39
  • Try issuing the requests in separate session each time. Every session IIRC has a separate connection pool. – dgatwood Feb 02 '17 at 18:25

0 Answers0