Questions tagged [nsmutableurlrequest]

NSMutableURLRequest is a subclass of NSURLRequest provided to aid developers who may find it more convenient to mutate a single request object for a series of URL load requests instead of creating an immutable NSURLRequest for each load.

Information : NSMutableURLRequest Class Reference

370 questions
0
votes
3 answers

iOS app dev- NSMutableURLRequest is nil

I am a new comer to iOS dev. Now I am faced with a weird problem. When I was running the following codes on iPhone 5 simulator, everything works fine. However, it doesn't work on my real iPhone 5. Can anybody do me a favour to help me find out the…
DianaDu
  • 43
  • 5
0
votes
1 answer

Do we need to handle the connection timeout of a process using NSURLSessionDataTask and NSMutableURLRequest

I am using NSURLSessionDataTask and NSMutableURLRequest. I noticed that the NSMutableURLRequest has a timeout (240 seconds I believe, which is a long time). I also read that NSURLSession has a timeout also but I am unsure of exactly what it is. My…
DevC
  • 6,982
  • 9
  • 45
  • 80
0
votes
0 answers

Open Mobile Site on iPad WebView

I am trying to load the mobile version of a site in a UIWebView on an iPad but I can only get it to load the desktop version. Am i doing something wrong? NSString *urlAddress =…
raginggoat
  • 3,570
  • 10
  • 48
  • 108
0
votes
0 answers

Send nested parameters in post request in NSMutableURLRequest

I have an app that sends data up to a Ruby on Rails server when a user edits an objects, but I'm having trouble sending nested items in the post request. This is my code: NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL…
jonathan
  • 103
  • 1
  • 7
0
votes
2 answers

How to find why NSMutableData is invalid

I access a RESTFUL url and get back results. The results are in JSON. I turn the response into a string via: - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *json = [[NSString alloc] initWithBytes:[self.receivedData…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
0
votes
1 answer

setValue:@"application/json" forHTTPHeaderField:@"Content­-Type" Not Working

Simple as it is: NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:linkURLString]]; [request setHTTPMethod:@"POST"]; [request setTimeoutInterval:10]; [request setValue:@"application/json"…
Abdalrahman Shatou
  • 4,550
  • 6
  • 50
  • 79
0
votes
1 answer

xcode - uploading an image with form parameters to a webserver

I am tring to upload an image with 3 parameters fror a form to a webserver unsuccessful. My code is: -(IBAction)uploadPhoto:(id)sender{ NSString *urlString = @"https://urlwebservice"; NSURL *url = [NSURL…
doxsi
  • 1,002
  • 19
  • 42
0
votes
2 answers

NSMutableURLRequest error Bad Header

I'm trying to send a picture to my server using HTTP POST on iOS 7/8. My problem is that I get an error on the request (pasted below) no matter which URL of my site is set. I sent an e-mail to my hosting company and they told me that it was due to…
Vincent Monteil
  • 568
  • 5
  • 22
0
votes
1 answer

NSMutableRequest array and dictionary in HTTPBody, server respond

Struggling to figure this out. Saw many examples, not sure what I'm doing wrong here. Need some fresh eyes. I have an array and a dictionary which I'm trying to send through HTTPBody, then return either one, just to see it it's working. Here's…
denikov
  • 877
  • 2
  • 17
  • 35
0
votes
0 answers

Why in URLRequest use "setValue: forHTTPHeaderField:"

I use GET/POST request in app, and in some example i see: [URLRequest setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [URLRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; Can you explain the significance…
biloshkurskyi.ss
  • 1,358
  • 3
  • 15
  • 34
0
votes
1 answer

Json response is giving wrong data

I am calling the webservice string using the NSURLConnection , I am getting wrong data in response in success method of NSURLConnection , But if i load same URL in browser i am getting correct response. I am using below code . NSData…
Romance
  • 1,416
  • 11
  • 21
0
votes
2 answers

Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding

I'm getting this error with this code : NSMutableURLRequest *request = [ [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:URL_LOGIN_API]] autorelease]; [request setHTTPMethod:@"POST"]; [request setValue:postLength…
Aymenworks
  • 423
  • 7
  • 21
0
votes
1 answer

Upload image file ios - Multipart format

Here is the webserice call URL: http://mywedshare.com/wp-admin/admin-ajax.php?action=app_photoupload gallery_ID,guestName, guestEmail, guestPasscode,photo_file (Multipart File Format) I need to upload an UIImage. Im getting my NSData using the…
Arjun Busani
  • 550
  • 1
  • 7
  • 15
0
votes
1 answer

Security of POST request ios

I am making post request form my application to server for login. I want to know is it safe? Is the data can be traced? For making a post request I am suing the following code: NSURL *s =[self getAbsoluteURL:url]; NSMutableURLRequest *requestURL =…
Rashad
  • 11,057
  • 4
  • 45
  • 73
0
votes
1 answer

How to use setHTTPBody method with NSString as argument?

I have to use a webservice which takes HTTP Body format as the following { "ScreenID" : "screenID1", "DeviceID" : "E7EF8DCE-CE8A-4F0C-BBC5-F080C29FEF29", "SessionStartTime" : "2014-03-27T06:50:15", "SessionEndTime" :…