Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 914275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:41:31+00:00 2026-05-15T17:41:31+00:00

When I run my NSURLRequest in Cocoa, I get a 303 HTTP error, which

  • 0

When I run my NSURLRequest in Cocoa, I get a 303 HTTP error, which is a redirect. How can I pull the proper URL to redirect to? Is it in the error variable, or somewhere else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:41:32+00:00Added an answer on May 15, 2026 at 5:41 pm

    You might want to check out the automatic handling of redirects with NSURLConnection:

    Handling Redirects and other Request Changes

    If you’d like to handle it manually, the redirect url is in the response’s ‘Location’ header. Here’s how you can grab it in your connection:didReceiveResponse delegate method.

    - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
        // ... if the response status is 303 ...
        if ([response respondsToSelector:@selector(allHeaderFields)]) {
            NSString* location = [[httpResponse allHeaderFields] valueForKey:@"Location"];
                // do whatever with the redirect url 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

run(/test.js) in mongo shell. i always get error run(/test.js) shell: started program /test.js sh2516|
When i Logger *logger = [Logger new]; NSURL *url = [NSURL URLWithString:@http://www.google.com]; NSURLRequest *request
I run command: sudo apt-get install phpmyadmin to install phpMyAdmin. Then I enter address:
I run this code here <html> <script type=text/javascript src=lib/jquery-ui-1.8.21.custom.min.js></script> <script src=http://127.0.0.1:5984/_utils/script/jquery.couch.js></script> <!--<script type=text/javascript src=lib/jquery-1.7.2.js></script>-->
I run into this problem. I have a textarea which I only want to
I am am trying to get multiple NSURLConnections to run in parallel (synchronously), however
I run a SaaS that allows free trials. Basically if you register you get
Run time error Cannot find column 0. below is my code string connectiostring =
I run a query sometimes and it just hangs. I go look at processes
I run a local directory website (think yelp/yell.com etc) and need to provide analytical

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.