• 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
Re: CFNetwork POST with redirect.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFNetwork POST with redirect.


  • Subject: Re: CFNetwork POST with redirect.
  • From: Joshua <email@hidden>
  • Date: Sun, 29 Apr 2007 08:57:52 -0700 (PDT)

This is a server I do have control of, but I believe the behavior is fairly common (my yahoo for example is a post with a redirect).

After reading the RFC you referenced I think I understand what you mean. It would seem that the server shouldn't return a 302, but instead return a 303. I'm not sure if I can control the redirect type, but clearly the behavior isn't uniform (the RFC even mentions some clients do treat a 302 as a 303, which is most likely what I am seeing in windows vs mac). I will look into seeing if I can get the server to send the 303 instead.

As to the hook in CFNetwork, I couldn't find one. I was expecting the same, that I could catch the event and then control the behavior, but I haven't found it in the portion of the API I have been using.

Thanks, you've given me something new to investigate.

- Josh

----- Original Message ----
From: Daniel Jalkut <email@hidden>
To: email@hidden
Cc: email@hidden
Sent: Sunday, April 29, 2007 11:09:34 AM
Subject: Re: CFNetwork POST with redirect.

On Apr 29, 2007, at 9:50 AM, Joshua wrote:
> Perhaps related... do CFNetwork interfaces automatically handle  
> cookies? The server is also trying
> to set a cookie and I am wondering if this is also the reason the  
> server doesn't continue the
> appropriate redirection.

I doubt the server's cookies have anything to do with it. The desired  
behavior for redirects is laid out pretty well in the HTTP RFC  
(http://www.ietf.org/rfc/rfc2616.txt) but it varies based on the type  
of redirect being encountered, and the request method. Many of the  
redirect cases hinge on prompting the user to confirm the new value.  
See section 10.3.x of the RFC.

So I imagine the "auto redirect" in CFNetwork is not really intended  
to be used for methods (namely, POST), where the user's interaction  
is generally required.

NSURLConnection has a "connection:willSendRequest:..." method where  
the client can manipulate redirect requests, but I'm not sure if  
CFHTTP has a similar hook.

Is this particular redirect you're running into something you're  
seeing in the wild, or is it a URL you're in charge of? If you have  
the ability to do so, it might make sense to avoid redirects on URLs  
where a 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: CFNetwork POST with redirect.
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: CFNetwork POST with redirect.
  • Next by Date: Re: CFNetwork POST with redirect.
  • Previous by thread: Re: CFNetwork POST with redirect.
  • Next by thread: Re: CFNetwork POST with redirect.
  • Index(es):
    • Date
    • Thread