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
2
votes
2 answers
OAuthConsumer - Sending image to server with OAMutableURLRequest
I'm using the OAuthConsumer library by Jon Crosby (google code link)
I have successfully set up my project with a access & request token/secret to make basic authorized http requests with the server (GET). However now I need to create a call that…

Jovan
- 2,640
- 2
- 24
- 34
2
votes
1 answer
NSURL from File -> Editing text of data then turn back into URL = NULL
I have an html file that I want to dynamically edit before displaying to change some of the values.
I get the file fine, then replace the text I want, still fine. But when I convert it back to a NSURL it shows NULL and WebKitErrorDomain error…

rsirota
- 321
- 3
- 15
2
votes
0 answers
Swift: URLSession or URLRequest adds extra headers. How to omit them?
I have set up a local express app to monitor requests made by my iOS app and found it odd that when printing the headers, one entry is
'accept-language': 'en-US,de;q=0.9'
because I did not set any specific headers at all. I tried to set nil for that…

user2330482
- 1,053
- 2
- 11
- 19
2
votes
1 answer
Parameters repeated while using NSURL to create new post on rails server using JSON
My issue is that when i POST to a rails server to create a new post using the following code from the iphone simulator, the parameters are sent twice.
NSDictionary *thestuff = [NSDictionary dictionaryWithObjectsAndKeys:
…

HDJ
- 137
- 2
- 7
2
votes
2 answers
`[[response allHeaderFields] objectForKey:@"Content-Length"]` is nil?
I wonder under what conditions an NSHTTPURLResponse object will not have key @"Content-Length" ? Is it usual/normal not to have that key?
I am trying something with the dropbox SDK and I've realized that
[[response allHeaderFields]…

nacho4d
- 43,720
- 45
- 157
- 240
2
votes
1 answer
NSURLRequest returning null
Someone knows why I'm getting null in this code?
NSURLRequest *requisicao = [NSURLRequest requestWithURL:
[NSURL URLWithString:URLAddress]];
When I debug this line and preview the content of this variable, I receive…

nobu86
- 55
- 9
2
votes
3 answers
NSURLConnection failure - 1003
I try to retrive data from certain url with command:
-(NSMutableData *) callUrl: (NSString *)url withData:(NSMutableDictionary *)data delegate:(id) delegate {
NSURL *executeUrl = [NSURL URLWithString:];
NSURLRequest *request =…

vitotao
- 91
- 1
- 2
- 5
2
votes
1 answer
Missing some cookies on NSURLRequest after changing to WKWebView
I am in the process of replacing UIWebView in our app with WKWebView and I have run into a cookie problem. There is a login process in our app where a webform is shown in a web view, and if the login was successful we call a service that gives us…

pajevic
- 4,607
- 4
- 39
- 73
2
votes
1 answer
How to distinguish between link requests in Objective-C
I have the following method in a UIViewController:
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType.
My webview has two links in the view; I want to be able…

jylee
- 833
- 2
- 8
- 15
2
votes
2 answers
UIWebView - Trouble displaying current URL in text field
I'm having problems getting the current URL through a URL request and passing it on to the text field above my web view. I tried logging it and it returns NULL, and the text field remains blank.
This is the delegate I added to my implementation…

user754314
- 63
- 1
- 6
2
votes
2 answers
CURL to URLRequest in Swift. (MUX LIVE STREAMING API)
Hello I am trying to create a live stream with mux api with a post request in my swift app.
This is what the cURL looks like. The MUX TOKEN ID & SECRET ID are defined in my app in swift:
curl https://api.mux.com/video/v1/live-streams \
-H…

jmapps9
- 87
- 1
- 7
2
votes
0 answers
Swift: How to add Dictionary format in forHTTPHeaderField in GET request
In GET request, I am trying to add header.
request.setValue(value: String?, forHTTPHeaderField: "SessionInfo")
But, SessionInfo value is in [String : Any]
Attempt 1:
func SO_Function() {
let service_url = WebService.sharedManager().serviceURL
…

McDonal_11
- 3,935
- 6
- 24
- 55
2
votes
1 answer
URLRequest fails before timeout
I want to set different timeouts for different requests. My request routine looks like:
var request = URLRequest(url: url,
cachePolicy: .reloadIgnoringLocalCacheData,
timeoutInterval: timeout)
//…

Valentin Shamardin
- 3,569
- 4
- 34
- 51
2
votes
3 answers
NSURLRequest problem
Hee,
I got a problem with my NSURLRequest HTTP POST and i cannot find out what is going wrong.
This is my server side php:

Mats Stijlaart
- 5,058
- 7
- 42
- 58
2
votes
2 answers
problem while getting key value for url to data , then to uiimage
I have a URL with tag:
http://ws.cdyne.com/WeatherWS/Images/sunny.gif
When I do like this:
NSURL *url=[NSURL URLWithString:@"http://ws.cdyne.com/WeatherWS/Images/sunny.gif"];
it's getting image in gdb and I am able to download from this URL. But…

Ketan Shinde
- 1,847
- 4
- 18
- 38