Questions tagged [nsurlconnection]

An NSURLConnection is the Apple Foundation Framework class that provides support to perform the loading of a URL request. It is deprecated and should be replaced by NSURLSession.

An NSURLConnection object provides support to perform the loading of a URL request. The interface for NSURLConnection is sparse, providing only the controls to start and cancel asynchronous loads of a URL request.

It is deprecated in iOS 9.0 and OS X 10.11 and should be replaced by NSURLSession.

NSURLConnection Class Reference

3110 questions
1
vote
0 answers

iOS: NSURLConnection & Checking for return code 301 and 302

I want to do a simple pinging to a url and if it returns codes 301 or 302(redirection) to do some re-direction for that url. I think since my url needs ssl certificate, the return code is always 0, I used the below code and it always returns…
Cam
  • 275
  • 6
  • 24
1
vote
1 answer

Handling timeout with Alert View - iOS

Is it possible to handle a request timeout with a UIAlert? I would like to inform the user that there has been a time out. I set 0.0 just for testing to see if it would occur. The log does not print out so i do not believe i am handling…
DevC
  • 6,982
  • 9
  • 45
  • 80
1
vote
1 answer

NSURLConnection sendAsynchronousRequest for image crashes in ios 4

Hi i am using following code to load the image using NSURLConnection SendAsynchronousRequest call for Tableview but it crashes for IOS 4.3 but same code works for IOS 5. So can anyone please tell me what changes i have to do support for IOS 4.3 i…
Abhilash
  • 638
  • 4
  • 11
  • 28
1
vote
1 answer

How to get the redirect URL using NSURLConnection, when server returns 'Moved temporarily' or 'Moved permanently'?

I have a URL with format schema://hostname (e.g. https://some.server.com). I'm trying to get the redirect page (in my case to a login form) (e.g. httpx://some.server.com/this/is/you/loginpage) Browsers will automatically redirect to this page, which…
1
vote
0 answers

NSURLConnection with the custom SSL validation

I have a question about an extended SSL certificate verification on iOS. The code I have looks as it follows: - (void) validateAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if (!someCustomCheck()) { // I do some custom…
Dmytro
  • 2,522
  • 5
  • 27
  • 36
1
vote
0 answers

willSendRequestForAuthenticationChallenge is not called using iOS 7 SDK

I can't get willSendRequestForAuthenticationChallenge called. This worked using iOS 6.1 SDK. Maybe something changed ?
Streetboy
  • 4,351
  • 12
  • 56
  • 101
1
vote
2 answers

NSUrlConnection not handling PUT method

I am Trying to Update data through NSUrlConnection using PUT method. For adding data i am using POST method it's working fine but the same time PUT it's not working. NSURL *url=[NSURL URLWithString:[NSString…
Chithri Ajay
  • 907
  • 3
  • 16
  • 37
1
vote
3 answers

Having trouble with multiple NSURLConnection

I've looked around a lot and cant seem to find a proper answer for my problem. As of now I have a network engine and I delegate into that from each of the view controllers to perform my network activity. For example, to get user details I have a…
Anil
  • 2,430
  • 3
  • 37
  • 55
1
vote
2 answers

How do you verify that NSURLConnection was successful

[NSURLConnection sendAsynchronousRequest:mutURLRequest queue:opQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; if(httpResponse.statusCode…
user2904379
  • 23
  • 1
  • 3
1
vote
2 answers

How to show UIView only when i received all data from server

I am getting data from server in my application. Currently I making this using NSUrlConnection and getting data in connectionDidFinishLoading. Mean while i am showing an alertView to user. but that time my view is not updated with data. I can only…
Uniruddh
  • 4,427
  • 3
  • 52
  • 86
1
vote
1 answer

NSURLConnection Error code (-1202,1012)

I am using NSURLConnection for one field service type iOS appliation, so app is field service type there are more then 50 users and more then 50 users may use the application on same time that's why there are more then 50 or 60 request come to the…
Nikh1414
  • 1,238
  • 2
  • 19
  • 35
1
vote
0 answers

Safari 7.0 (Mavericks) lost connection when trying the following URL

When I try to access this on Safari 7.0 (or on IOS 7) I am getting a connection lost. But on Safari 6.0.5 (or IOS 6.0.1) the link works fine. Does anybody encounter a similar issue or know the cause of it? Thanks alot. I saw that the error is -1005…
Guy
  • 11
  • 2
1
vote
2 answers

ios simulator proxy settings not working

TL;DR; Safari mac OSX browser reaches address fine, iOS simulator gets 407'ed Long Version Guys, there's something very wrong here... around the internet i keep reading that the iOS simulator will use the mac OSX proxy settings, but i keep getting a…
Leonardo
  • 10,737
  • 10
  • 62
  • 155
1
vote
0 answers

NSURLConnection lost data

I need to communicate with server with SOAP request and get response. I have quite good method which creates XML request with parameters, transform it to NSMutableURLRequest and send with NSURLConnection. All of it works fine so I'll skip this part…
1
vote
1 answer

NSURLResponse expectedContentLength -1

I have an NSURLConnection that connects to a PHP API I have made. That PHP API responds with data. Since it is a dynamic application, I do this to tell the content length: ob_start('scAPIHandler'); function scAPIHandler($buffer){ …
arik
  • 28,170
  • 36
  • 100
  • 156