on iOS , NSURLRequest objects represent a URL load request in a manner independent of protocol and URL scheme. NSURLRequest encapsulates two basic data elements of a load request: the URL to load, and the policy to use when consulting the URL content cache made available by the implementation.
Questions tagged [nsurlrequest]
1095 questions
5
votes
3 answers
Change User-Agent
How can I change in my WebView the default string of User-Agent?
@IBOutlet weak var myWbView: UIWebView!
let myURL = NSURL(string: "http://http://web-example")
let myURLRequest:NSURLRequest = NSURLRequest(URL:…

Phocs
- 2,430
- 5
- 18
- 35
5
votes
1 answer
iOS - Re-Attempt Failed NSURLRequests In NSURLSession
In my app, 2-4 API calls to my server can be happening at the same time (asynchronously) within my API class's NSURLSession. In order to make API requests to my server, I must supply the authentication token in the HTTPHeaderField of each…

Rafi
- 1,902
- 3
- 24
- 46
5
votes
4 answers
Load UIImage from URL in iOS
I am trying to load a UIImage from its URL with completionand placeholder image , but neither the UIImage nor the placeholder UIImage are loaded.
Here is my code:
NSURL *url = [NSURL…

Ahd Radwan
- 1,090
- 4
- 14
- 31
5
votes
2 answers
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…

kiteloop
- 1,057
- 13
- 16
5
votes
4 answers
How do I submit a JSON array to this API?
I'm trying to use Diffbot to parse some URLs into the relevant article portion. They have an "Article API" that allows you to submit one link at a time and receive it back, but for speed I'd prefer to use the Batch API which basically allows you to…

Doug Smith
- 29,668
- 57
- 204
- 388
5
votes
1 answer
ajax of type PUT or POST in UIWebView does not pass HTTP body
I am opening a simple HTML document inside UIWebView in my app:
Testing Put
5
votes
2 answers
NSURLConnection NSURLRequest proxy for asynchronous web service calls
I have multiple views which make the same NSURLRequest/NSURLConnection request. Ideally, in order to get some code reuse, I'd like to have some sort of a "proxy" which does all the underlying work of creating/executing the (asynchronous)…

tbehunin
- 1,043
- 1
- 12
- 24
5
votes
3 answers
Base64 encoded image corrupted during transfer to server
For some reason i can't upload a jpeg file to a server using the post method in NSURLRequest
I have an android app that uses the same php code and can upload and download images fine by converting the image to a byte array and then using base64…

Matthew Bailey
- 103
- 2
- 5
5
votes
3 answers
Cannot get iOS http post to work using NSURLConnection
I'm trying to get a POST message working. I've seen a couple of posts describing doing so, such as this one, but I still cannot get it working. Below is my objective-c code:
NSString * urlString =…

Kyle
- 17,317
- 32
- 140
- 246
5
votes
3 answers
AFNetworking: Can't get the response string from AFHTTPRequestOperation
Anyone?): I'm having a problem that has made me scratch my head for the last 2 hours, and it most likely a very simple stupid thing I'm missing. I Keep getting a building error when I Call the response string from the operation @ AFNetworking...…

Hernan Arber
- 1,626
- 3
- 22
- 35
5
votes
2 answers
Correlate NSURLRequest with UIWebView
In iOS, I'd like to be able to associate an NSURLRequest--any NSURLRequest, whether a navigation request or image or stylesheet request--with the UIWebView that sent it. This seems to call for the implementation of an NSURLProtocol subclass to…

KevinH
- 2,034
- 1
- 12
- 12
5
votes
3 answers
NSURLRequest Timeout IOS
I need to set timeout 15sec or 30 sec with UIRequest, but it always takes default one. Is there any way to set minimum timeout to connection.

Codesen
- 7,724
- 5
- 29
- 31
5
votes
1 answer
NSURLRequest Cache Policy
I am using NSURLRequest with CachePolicy to download a plist in NSData. When I change the content of my plist my app is ignoring this and still presents the content which is cached. How long does the cache persist? If so is there an option to say…

halloway4b
- 573
- 1
- 11
- 23
4
votes
1 answer
NSURLRequest http protocol version
It is quite a simple question from me today. Is it possible to set specific HTTP protocol version to NSURLRequest object (1.0 or 1.1, for example)?
An example of what I'm talking about on telnet:
pavlov:~ pavlov$ telnet ya.ru 80
Trying…

Valerii Pavlov
- 1,986
- 1
- 19
- 30
4
votes
2 answers
What is the Difference between CFUrl and NSUrl
I would like to send a simple HTTP to a web server in Objective-C.
From what i've seen, the most common way is to use the NSURLRequest with NSUrl....
But i have also stumbled upon the CFNetwork Library which can also be used to communicate with web…

Sagi
- 981
- 11
- 15