Questions tagged [sendasynchronousrequest]

100 questions
1
vote
2 answers

Check whether internet connection is available

I am writing a function that checks whether a users device is connected to the internet. If it is not it warns the users with an Alert box. Initially I was using the following below which worked perfectly: var data = try…
Skywalker
  • 4,984
  • 16
  • 57
  • 122
1
vote
1 answer

NSIS: Make async web request with query string

How do I make an asynchronous GET request to URL like http://www.example.com/somepage?param1=val1¶m2=val2 in NSIS. I don;t care about response - all I want is make a request and disregard response (so not for downloading files). Currently I use…
Fit Dev
  • 3,413
  • 3
  • 30
  • 54
1
vote
0 answers

Objective-C - Network services getting timeout error when app running on background for a long time

I'm developing a little Objective-c app, and everything works fine, but when I run it on my iPhone and I let the app on background for a long time (all day for example) all network services get a timeout error, but if I close the app and start it…
1
vote
1 answer

iOS Swift - NSURLConnection.sendAsynchronousRequest cancel request

I'm trying to cancel an asynchronous request if there is a problem with the internet connection. var connection: NSURLConnection! self.connection = NSURLConnection.sendAsynchronousRequest(request2, queue: NSOperationQueue.mainQueue()) { …
1
vote
0 answers

Json : Save Images into CoreData in Swift

I’m now stuck little bit. First, my code is as follows, import UIKit import CoreData class ViewController: UIViewController { var eTitles : [String] = [] var jTitles : [String] = [] var pCategories : [String] = [] var imgPaths : [String] =…
Gunther
  • 21
  • 3
1
vote
2 answers

New value is only available in sendAsynchronousRequest - Swift

var arrayData: [String] = [] let bodyData = "parameter=test" let URL: NSURL = NSURL(string: "Link to php file") let request:NSMutableURLRequest = NSMutableURLRequest(URL:URL) request.HTTPMethod = "POST" request.HTTPBody =…
Clément Bisaillon
  • 5,037
  • 8
  • 32
  • 53
1
vote
0 answers

calling sendAsynchronousRequest too many times

In ios 6, I have an image downloader method that calls sendAsynchronousRequest. When number of images are too many completion blocks are never called and there are over 60 worker threads that are never destroyed(so the image downloading is never…
andylee
  • 255
  • 2
  • 6
1
vote
1 answer

NSURLConnection sendAsynchronousRequest results in "A server with the specified hostname could not be found"

I'm doing some network requests using [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:completionHandler]. Unfortunately, half the time I perform these requests, I get an NSError with A server…
1
vote
2 answers

NSURLConnection status code for Asynchronous request iOS 6

Currently using sendAsynchronous from NSURLConnection to make post and get requests, but can't get the status code in the response. Most post suggest the use of NSURLConnection and its delegate methods, which I understand are also Asynchronous. I…
1
vote
2 answers

Ignoring SSL certificate errors with NSURLConnection

I'm using [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)] to pull data from a web service, but the web server has a self-issued…
colincameron
  • 2,696
  • 4
  • 23
  • 46
1
vote
1 answer

NSURLConnection sendAsynchronousRequest completionHandler logs appearing before updating the UI

I have this code to send a json string to a server [NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError…
okawei
  • 1,447
  • 2
  • 12
  • 11
1
vote
2 answers

Why does Asynchronous URL Request return error when iPhone is turned off?

I am developing an iOS application and I'm using the NSURLConnection sendAsynchronousRequest: queue: completionHandler: method. When I started testing the app on the iPhone, whenever the app is calling the method and I lock the phone, the method…
1
vote
1 answer

Cancelling sendAsynchronous request

I am using sendAsynchronous request to receive data from multiple request at same time. It works great, i am able to load all the data. Even it is faster. But i want to cancel my request if the user cancels the request. so i have created a NSThread…
Sasi
  • 1,666
  • 2
  • 24
  • 44
1
vote
2 answers

better understand of NSURLConnection with NSOperationQueue

I make a queue NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init]; I send the queue to my async request [NSURLConnection sendAsynchronousRequest:req queue:operationQueue completionHandler:^(NSURLResponse *response, NSData *data,…
Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
0
votes
1 answer

Can't fix `NotFoundException` error when calling SendApiAsset in AWS CLI

Recently, I have been trying to access a data products from the AWS marketplace using the AWS CLI. I have an active subscription on the product; however, I get the NotFoundException error whenever I try to access any of the product's endpoints via…