nsurlrequest

NSMutableURLRequest timeout issues

Hello, I'm using Eric Czarny's XML-RPC framework for my iPhone app. There is an XMLRPCRequest class which contains an NSMutableURLRequest object. I wanted to set it's timeout to say 10 or 20 seconds, however regardless of that I always measure a timeout of about 75 seconds. Now according to this post, the standard timeout for POST reque...

How to use NSURLRequest / NSURLConnection to download an mp3 file to app?

The Situation In my app, I am currently downloading an mp3 file (to docs directory) using [NSData dataWithContentsOfURL:URL], a method that works fine, but ties down the CPU, dissallowing screen updates of download status. So, I want to download using a different method so that I can update the screen WHILE downloading to alert the user ...

Doing 2 NSURLRequests after each other

Hello, I'm trying to do two NSURLRequests after each other. The second request is based on the results from the first one. My first request is working fine. I have set the delegate to self and I'm informed when when the request is finished (in the connectionDidFinishLoading method). My question is now, how can I do the second request a...

Does disk caching with NSURLRequest and NSURLConnection actually work on the iPhone?

I have a UITableView whose cells contain custom ImageViews that asynchronously load the images from the internet. To load those images I use NSURLRequest and NSURLConnection which works fine. The only problem is that the images are not cached and therefore are downloaded every time they are used. I tried to set the cachePolicy of the NSU...

iphone: applicationWillTerminate not called during a NSURLRequest?

Hi, I am working on an application where the user at some point must wait for a proper response from a webservice. This might take some time, because it requires a manual confirmation from the webservice. Because of this, the timeoutInterval on the request is set very high to prevent it from terminating too early. The problem comes w...

Storing GIF's in SQLlite on iphone

Hi, I am looking for some advice on the best strategy for getting / putting GIF files in an SQLlite Database and how to initialize the ImageView. I have images stored on URLs that can be downloaded but I'm not sure the best method to get them stored into the SQlite database. should it be NSURLRequest - NSData - BLOB then retrieve ...

How do I share Safari's NSURLCache store?

Background I'm building an app that links recent web pages you've visited together. To do this, I need to get the HTML for recent URLs using Cocoa. Right now, I'm using an invisible WebView to do this. As I understand it, if the URL isn't in the cache for my app, this is hitting web servers. What I want The chances are high that t...

Resume download functionality in NSURLConnection

I am downloading some very large data from a server with the NSURLConnection class. How can I implement a pause facility so that I can resume downloading? ...

NSManagedObjectContext losing data after 2nd save

I have a class called DataRequest, which handles downloading data from a web service via NSURLRequest, parsing the results and stuffing data into a NSManagedObject, and saving it. It contains the fowlling: @property (nonatomic, retain) id DataControllerProtocol dataController; I also have a class called DataController, which encapsul...

NSURL from NSURLConnection?

It seems dead simple, as to create an NSURLConnection I usually do this: NSURL *theURL = [NSURL URLWithString:urlString]; NSURLRequest *req = [NSURLRequest requestWithURL:theURL]; NSURLConnection *connection = [NSURLConnection connectionWithRequest:req delegate:self]; But how can I get the URL back in the delegate methods? Short of ha...

How to add lowercase field to NSURLRequest header field?

I'm getting pretty frustrated figuring out how to add a lowercase header field to an NSMutableURLRequest. NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:MyURLString]]; [urlRequest setValue:@"aValue" forHTTPHeaderField:@"field"]; In the example above, "field" gets switched to "Field," since...

Using NSURLRequest to pass key-value pairs to PHP script with POST

Hi, I'm fairly new to objective-c, and am looking to pass a number of key-value pairs to a PHP script using POST. I'm using the following code but the data just doesn't seem to be getting posted through. I tried sending stuff through using NSData as well, but neither seem to be working. NSDictionary* data = [NSDictionary dictionaryWit...

iPhone: ASIFormDataRequest Returns NULL from PHP Server

Hi, I have PHP script link, which responds YES or NO when we set post userName and emailID. I have used ASI framework. When I try to connect with the following code, I get a null return. NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"]; ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithU...

NSURLConnection/NSURLRequest gzip support!

Hi everyone! Does anyone knows if NSURLConnection/NSURLRequest have support for gzip requests. If does, can you provide more information? Thanks in advance! ...

NSMutableURLRequest not obeying my timeoutInterval

I'm POST'ing a small image, so i'd like the timeout interval to be short. If the image doesn't send in a few seconds, it's probably never going to send. For some unknown reason my NSURLConnection is never failing, no matter how short I set the timeoutInterval. // Create the URL request NSMutableURLRequest *request = [[NSMutableURLReque...

iPhone app getting XML then refreshing it at intervals...

I have an app which gets some data from the web via an XML document. I have this working fine and have followed apples SeismicXML example (uses NSURLRequest etc). I am very new to this so I have to admit that I do not totally understand all the code that gets the XML - but it is working. My problem is that my app may be running for some ...

Cocoa - Is there a way to check on whether not a cache exists for a NSURLConnection?

I would like to be able to log monitor/log when a local machine cache is being used or when the data is being drawn from the remote source. is there a NSURLConnection.cacheExists method? Or better still one that shows the expiration date or other cache details? ...

How can I create a single HTTP Get request for iPhone?

Hi guys! First of all, sorry for my posibly bad english... I got a surely big stupid question... In my enterprise have an automatic door system, that is opened with a HTTP GET request to a file. Example: http://ipaddress/rc.cgi?o=1,50 Where the o=number indicates the amount of seconds that the automatic door will run. The is no need...

iPhone - NSURLConnection does not receive data

Hi, I have a pretty weird problem with NSURLRequest. I'm using them to make an asynchronous image loading in an UITableView. The first time the tableView displays, all connections from NSURLRequests open correctly but receive absolutely no data, regardless of how long I wait. But as soon as I scroll down in the tableView, the newly crea...

NSURLConnection, NSURLRequest, untrusted cert and user authentication

Morning Everyone, I've been attempting to write an application that does some GETs from a remote Web Service that requires authentication. My main problem is that the majority of these remote servers (and there are a lot of them) don't have valid certificates. I've got code to accept the invalid certificate and code to respond to the ch...