• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLConnection: setting Connection: close HTTP header
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection: setting Connection: close HTTP header


  • Subject: NSURLConnection: setting Connection: close HTTP header
  • From: Nicolas Berloquin <email@hidden>
  • Date: Thu, 6 Oct 2005 20:22:02 +0200

Hello !

I'm using an NSMutableURLRequest to launch a [NSURLConnection connectionWithRequest: delegate:] request.
Before opening the connexion, I try to set all the HTTP header fields as follows, but the Connection: close is
always transformed into a 'keep-alive' connection (as I verified with tcpdump).
Is there anything I should do for it to work ?

    [trackerRequestNSURL setAllHTTPHeaderFields: 
        [NSDictionary dictionaryWithObjectsAndKeys: @"BitsOnWheels1.0PR1.5b1", @"User-Agent", 
                                                    @"close", @"Connection", 
                                                    @"gzip", @"Accept-Encoding", 
                                                    @"*/*", @"Accept", 
                                                    _realHost, @"Host", 
                                                    nil]
    ];

PS as a side question : do I have to set the Host: field myself in this case, or will it be filled by cocoa ?

thanks !

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSURLConnection: setting Connection: close HTTP header
      • From: Becky Willrich <email@hidden>
  • Prev by Date: Fwd: Crashes in CFReadStreamRead()
  • Next by Date: SSLRead() causes SSLWriteFunc to be called?
  • Previous by thread: List Terms and Conditions
  • Next by thread: Re: NSURLConnection: setting Connection: close HTTP header
  • Index(es):
    • Date
    • Thread