Questions tagged [nsurlrequest]

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.

1095 questions
11
votes
3 answers

"No Action header was found" error message while using SOAP webservice

Getting following error while consuming SOAP webservice in iOS App "No Action header was found with namespace 'http://www.w3.org/2005/08/addressing' for the given message." The same webservice working fine in SOAP UI Tool. Following is the request…
prasad
  • 1,976
  • 2
  • 28
  • 51
11
votes
2 answers

NSURLRequest: How to handle a redirected post?

I have a tried and tested use of NSURLRequest (and accompaniments) implementation, that works great for GETs, and POSTs for a given URL. However, I want to now move the target of the URL without changing the URL used by the app, so I'm intending to…
Snips
  • 6,575
  • 7
  • 40
  • 64
10
votes
4 answers

function with dataTask returning a value

I wan't to check if my url statusCode equals to 200, I created a function returning a Boolean if the statusCode equals to 200, I'm using a dataTask, but I don't know how to return a value: class func checkUrl(urlString: String) -> Bool{ let…
Ben
  • 761
  • 1
  • 12
  • 35
10
votes
1 answer

NSURLRequest produce different result than HTTP proxy client

I send the same HTTP message from a HTTP proxy client and with NSURLRequest + NSURLConnection, and get back different result. It is an authentication request. From HTTP proxy authentication request is accepted, sending from app not. Why? Accepted…
János
  • 32,867
  • 38
  • 193
  • 353
10
votes
2 answers

Setting client-side timeout per request with Alamofire [swift]?

I'm trying to set a client-side timeout per request for Alamofire for Swift. The lead architect told me to set this on NSURLRequest, but I'm completely confused on how to actually do that in practice. Can someone who has done this give an example?…
Troy Payne
  • 343
  • 2
  • 3
  • 9
10
votes
1 answer

Change User-Agent and remove App Name and defaults iOS

I am trying to change the User-Agent in iOS, however when I add my custom User-Agent it appends it to the existing User-Agent that contains my app name. This is the code I am using: NSMutableURLRequest *request = [client requestWithMethod:@"POST"…
Darren
  • 10,182
  • 20
  • 95
  • 162
10
votes
5 answers

Get cookies from NSHTTPURLResponse

I've an extremely weird problem, I'm requesting a URL and I want to get the cookies from it, I've used this way to get the cookies: - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { NSHTTPURLResponse…
Scar
  • 3,460
  • 3
  • 26
  • 51
10
votes
5 answers

Handling a NSURLRequest with timeout when using delegate

I'm using a NSMutableURLRequest to connect to a web site to get a JSON response. I'm doing so by generating the request, and then using NSURLConnection with a delegate of self to handle the async connection. I've implemented all the normal…
Parrots
  • 26,658
  • 14
  • 59
  • 78
10
votes
3 answers

NSURLErrorDomain error -1012

I need to parse a xml file from a password protected URL I tried the following NSURLCredential *credential = [NSURLCredential credentialWithUser:@"admin" password:@"123456" persistence:NSURLCredentialPersistenceForSession]; NSURLProtectionSpace…
Piyush
  • 244
  • 1
  • 2
  • 8
10
votes
2 answers

Request with NSURLRequest

I'm trying do to an app which uses a database (actually in my localhost), I tried with ASIHTTPRequest but having so much troubles with iOS 5 (I learnt how to use ASIHTTPRequest form there :…
Edelweiss
  • 621
  • 1
  • 9
  • 24
9
votes
1 answer

Resolve redirect of NSURL?

I have a shortened URL (e.g. t.co/12345678). I would like to resolve the redirect without having to the load the entire page via NSURLConnection. Obviously, I can get it by sending an NSURLConnection and awaiting the response but this loads the…
Keller
  • 17,051
  • 8
  • 55
  • 72
9
votes
1 answer

Sending multipart POST from iOS and reading parameters in PHP $_POST?

I'm trying to send a multi-line post from an iPhone/iPad to a php service, the problem is that for some reason, the POST Content-Type seems to be application/x-www-form-urlenconded, ( I found out this using Wireshark ) This is actually a snippet of…
Goles
  • 11,599
  • 22
  • 79
  • 140
9
votes
2 answers

How to set time out in NSURLRequest in iphone

I'm trying to disconnect or stop loading URL request in 15 secs, when internet connection get disconnected. i tried with setTimeoutInterval in NSURLRequest, which is not working. can any know how to resolve the issue?
sri
  • 3,319
  • 7
  • 34
  • 48
9
votes
4 answers

NSURLConnection leak?

i have set up a nsurl which grabs the data from http. when i run instrument, it says i have a leak NSFNetwork object. and how do i release theConnection in (void)ButtonClicked? or it will be release later on? - (void)ButtonClicked { …
8
votes
2 answers

NSURLRequest: How to change httpMethod "GET" to "POST"

GET Method, it works fine. url: http://myurl.com/test.html?query=id=123&name=kkk I do not have concepts of POST method. Please help me. How can I chagne GET method to POST method? url: http://testurl.com/test.html [urlRequest…
ChangUZ
  • 5,380
  • 10
  • 46
  • 64