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 993201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:23:02+00:00 2026-05-16T06:23:02+00:00

how to request url to execute or connect to server .. what i was

  • 0

how to request url to execute or connect to server ..
what i was using not working..

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@",[ConfigDB valueForKey:@"mailURL"], @"?ownerID=", [ConfigDB ownerID], @"&userid=",[ConfigDB userID],@"&pID=",pid,@"&emailAddress=",emailTxtField.text,[ConfigDB valueForKey:@"showEmailFlag"]]]; 


NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:url];
  • 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-16T06:23:03+00:00Added an answer on May 16, 2026 at 6:23 am

    That’s quite a stringWithFormat message! The first thing to check is that you’re getting a URL that matches your expectations.

    Once you’ve got a URL request object—and consider using a regular NSURLRequest, it should be faster and it doesn’t look like you’re intending to reuse this object:

    // already autoreleased
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    

    Then you need to actually make the request. There are two approaches here. You’ll use NSURLDownload if you’re looking to save the request to file. It looks like you’re looking to make a GET request to an email server of some sort, so you probably want the other approach: NSURLConnection.

    NSURLConnection is mostly intended for asynchronous requests. You provide a delegate with some methods and your NSURLConnection will use those methods to let you know when the communication is done; whether there were errors; etc.

    Add a property to your view controller class for the connection, and an NSMutableData property as well. You will start your connection with (assuming that your current class is also your delegate):

    // initialize our storage for the file
    self.downloadData = [NSMutableData dataWithLength:1024];
    // create and start the connection
    self.urlConnection = [NSURLConnection connectionWithRequest:request delegate:self];
    if(nil == self.urlConnection) {
        NSLog(@"Couldn't create connection to url %@", url);
    }
    

    In your code somewhere—probably your current view controller—you’ll need to implement those methods:

    -(void) connection:(NSURLConnection*)connection didReceiveData:(NSData*)data {
        // if you have more than one NSURLConnection in this class, test against the 
        // connection parameter
    
        [downloadData appendData:data];
    }
    
    -(void) connectionDidFinishLoading:(NSURLConnection*)connection {
        // download completed successfully, we can do what we like with the downloadData object now
        // ...
    }
    
    -(void) connection:(NSURLConnection*)connection didFailWithError:(NSError*)error {
        // handle failure with the grace of Audrey Hepburn.  probably log something, too
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.