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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:58:49+00:00 2026-06-05T08:58:49+00:00

I am using ASIHTTPRequest to interact with my website. I am basically adding ASIHttpRequests

  • 0

I am using ASIHTTPRequest to interact with my website. I am basically adding ASIHttpRequests to a queue. It all works fine if there is an internet connection. However, I guess the operation gets deleted if the request fails (ie, no internet connection)

Is there a way to queue and execute the request only when there’s internet connection? If there’s no internet connection, the request should be queued and automatically sent when the connection returns. If this is not possible, what is the best way to accomplish what I am trying here?

Thanks!

This is how I am setting up the queue right now :

NSURL *url = [NSURL URLWithString:@"http://www.tst.com.au/test.php?op=updateField"];

        ASIFormDataRequest *startHourRequest = [ASIFormDataRequest requestWithURL:url];

        NSDateFormatter *apiformatter = [[ [NSDateFormatter alloc] init] autorelease];
        [apiformatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
        NSString *webdate = [apiformatter stringFromDate:date];
        [startHourRequest setDelegate:appDelegate];
        [startHourRequest setPostValue:webdate forKey:@"fieldvalue"];
        [startHourRequest setPostValue:[appDelegate shiftuid] forKey:@"uid"];
        [startHourRequest setPostValue:editAttribute forKey:@"fieldname"];
        [startHourRequest setDidFinishSelector:@selector(requestDone:)];
        [startHourRequest setDidFailSelector:@selector(requestWentWrong:)];
        [[appDelegate queue] addOperation:startHourRequest];
  • 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-06-05T08:58:50+00:00Added an answer on June 5, 2026 at 8:58 am

    Yes you can do that quite easily with the Reachability class:

    First off you will check internet reachability before you send the initial request:

    Reachability *reachability = [Reachability reachabilityForInternetConnection];    
    NetworkStatus internetStatus = [reachability currentReachabilityStatus];
    if (internetStatus != NotReachable) {
        //Do your request
    }
    else {
        //save your url to an array for use when the internet returns
    }
    

    and within the view controller or wherever you are sending the requests from you do this to listen for internet changes

    - (void)viewDidLoad
    
        [[NSNotificationCenter defaultCenter]
         addObserver:self 
         selector:@selector(networkStatusChanged:) 
         name:kReachabilityChangedNotification 
         object:nil];
    
        internetReachable = [Reachability reachabilityForInternetConnection];
        [internetReachable startNotifier];
    }
    
    - (void)networkStatusChanged:(NSNotification *)notice {
        NetworkStatus internetStatus = [internetReachable currentReachabilityStatus];
        if (internetStatus != NotReachable && [yourUrlsToSend count] > 0) {
            //send off your requests now that you have internet
    
        }
    }
    

    This all depends on including the reqchability files from apple which can be found here: enter link description here . Hope that helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASIHTTPRequest to send request to web server. It all works fine.
I'm using ASIHTTPRequest to make a queue request, But i was wondering if there
I am succesfuly using AsiHttpRequest library to make url connections in my apps. However,
I'm using ASIHTTPRequest in my iOS project. i would like to see all the
I'm using ASIHTTPRequest to download data from the internet. If I lose my internet
I am using ASIHTTPRequest, its working fine for posting dictionaries to the web service
I am using ASIHTTPRequest 1.6.2 lib for all http transactions in IPhone. But i
Im building api for our rest api using ASIHTTPRequest. Api wraps all requests to
How can I establish a HTTPS connection, using ASIHTTPRequest or just plain NSHTTPRequest, using
im using Asihttprequest for my HTTP request, and my app will handel 3 language

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.