Questions tagged [nshttpurlresponse]
50 questions
1
vote
0 answers
NSHttpURLResponse contains different values on device than on simulator from xamarin iOS app
I am making an iPhone app on xamarin. I am encountering a very baffling issue. I am making an NSURLConnection to a link to get the cookie information from header and use that cookie to open other protected links. In connection:didReceiveResponse:…

Juli Gupta
- 93
- 1
- 10
1
vote
0 answers
response.expectedContentLength allway return -1
i have a connection use NSURLConnection, i want to draw a progress for this connection but when i try to print current received data and total data length, something went wrong ,response.expectedContentLength allway return -1, why and what happen…

Makio
- 465
- 6
- 15
1
vote
3 answers
Objective-C iOS NSURLConnection statusCode 400 No body returned
not really sure where to start here other then to dive into CF (I REALLY don't want to do that) but....
I have an NSURLConnection signing OAuth2 requests to an ASP.NET WebAPI Resource Server, this resource server returns JSON body AND statusCode…

Holyprin
- 348
- 1
- 9
1
vote
1 answer
Getting longitude and latitude through "www.google.com/glm/mmap"
How to get longitude and latitude via LAC and CELLID?

xiaomage
- 11
- 3
0
votes
0 answers
Getting statusCode other than 200...299 in HTTPURLResponse of URLSession
the following is my APIManager code, I'm using it in all my apps. But sometimes, the guard statement fails in connectToServer function, which means the statusCode of HTTPURLResponse other than 200...299 and the thing here is even after getting…

Harsha
- 760
- 1
- 7
- 21
0
votes
1 answer
How to save Cookies from HTTPURLResponse
I am working on a login application, After successful login response comes back with 2 cookies, i want to get this 2 cookies from the header of my HTTPURLResponse but i couldn't (httpResponse fields didn't contain the cookies) How can I find and…

aminoo
- 59
- 4
0
votes
0 answers
How to find the actual "Content_Type" of the NSURLRequest before downloading it
I want to know the content_type of the NSURLRequest before it is downloaded.
As much as I searched I found the below code as solution :
NSURL *url = [NSURL URLWithString:urlString];
NSMutableURLRequest *httpRequest = [NSMutableURLRequest…

Jeba Moses
- 809
- 8
- 25
0
votes
5 answers
How to get result in blocks immediately?
I'm using blocks to get header fields from response in one class and I have to get that in another class.
I implemented code like this
In first class:
- (void)viewDidLoad {
[super viewDidLoad];
UserAuthentication *auth =…

Himanth
- 2,381
- 3
- 28
- 41
0
votes
1 answer
Alamofire, Swift 2.0, SwiftyJSON: Parse response body as JSON
I have successfully completed a POST request to server and I am trying to parse the response JSON but I have been unsuccessful.
Alamofire.request(.POST, ServerConfig.ADD_SELLER_URL, parameters: sellerJSON, encoding: .JSON, headers: nil)
…

dashbashrumble
- 251
- 1
- 5
- 19
0
votes
1 answer
NSHTTPCookie cookiesWithResponseHeaderFields
When making a call to an API, I receive this as response:
{ URL: https://insula.magister.net/api/sessie } { status code: 201, headers {
"Cache-Control" = "max-age=120, private";
"Content-Length" = 0;
…

jbehrens94
- 2,356
- 6
- 31
- 59
0
votes
1 answer
I'm getting header info for a file that doesn't exist?
I'm using code that I got from a tutorial for finding the "Date Modified" info of a file on a server. It goes as follows...
// create a HTTP request to get the file information from the web server
NSMutableURLRequest* request = [NSMutableURLRequest…

Nerrolken
- 1,975
- 3
- 24
- 53
0
votes
0 answers
NSURLSessionDataTask Method rewrite in Swift
I'm trying to write a NSURLSessionDataTask in Swift, and I'm not sure how to, I have this Objective C method, that is doing pretty much exactly what I'm wanting to do in Swift.
NSURLSession *session = [NSURLSession…

douglas bumby
- 324
- 1
- 4
- 13
0
votes
2 answers
iOS url response bool
net web service that returns true or false but i don't know how to catch that response in my IOS App.
My service updates data in a database and i know it works the data gets updated it's catch the response that is the problem, i like to know so i…

Madde Persson
- 413
- 1
- 6
- 26
0
votes
0 answers
Modifying NSHTTPResponse given to UIWebview
I have seen all sorts of questions about modifying NSURLRequest but not NSHTTPURLResponse. Our scenario is that:
A web page that is loaded in a UIWebview will make an HTTP request. This is typically a form post in a hidden iFrame or AJAX request.…

user1910629
- 81
- 1
- 6
0
votes
1 answer
how to get responseString when JSON failed with AFJSONRequestOperation
I'm having difficulties to get responseString when server failed to send a valid JSON response (fe. php echos some temp variable or something went wrong). I am using AFJSONRequestOperation from AFNetwoking like this:
AFJSONRequestOperation…

patryk
- 642
- 1
- 9
- 18