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
3
votes
0 answers

Why does AFNetworking NSMutableURLRequest image upload always timeout?

I am unable to use AFNetworking NSMutableURLRequest to upload a picture -- it always times out. I can make successful GET requests to the same server: AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; [manager…
chris wang
  • 351
  • 2
  • 4
  • 7
3
votes
3 answers

unsupported URL error code -1002

Hi Please help me how to prepare NSMutableURLRequest for below api URL : www.XXXXXXXX.com/api.php For Login :- www.XXXXXXXXXXXX.com/api.php?task=login POST Data :- "email" => User's email "pw" => User's Password json response: session id on…
Enmud
  • 83
  • 1
  • 1
  • 9
3
votes
3 answers

NSMutableURLRequest "The request timed out" issue . .

I am trying to download data in my application by using the following code NSURL *url = [NSURL URLWithString:@"my download url string"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url…
3
votes
1 answer

setting content-type overwriting httpbody?

I'm having a weird issue calling an API from my ios app. I create a post request NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url …
Cheryl Yaeger
  • 69
  • 1
  • 6
3
votes
2 answers

NSMutableURLRequest sends partial post body

I'm sending a base64 encoded image to a server as part of a post request using NSMutableURLRequest. What I log as the post body and what the server receives are not the same thing. The server seems to get a truncated version, as though the…
brodney
  • 1,176
  • 2
  • 14
  • 29
3
votes
1 answer

How can I use query string (--data-urlencode) in an NSMutableURLRequest?

I want to translate the following GET request to an instance of NSMutableURLRequest: curl -X GET \  -H "X-Parse-Application-Id: sdasfasdf" \  -H "X-Parse-REST-API-Key: asdfasdfasdfasd" \  -G \  --data-urlencode 'where={"arrayKey":2}' \ …
Lucas
  • 6,675
  • 3
  • 25
  • 43
3
votes
1 answer

Cookies not sent with NSMutableURLRequest

Firstly, the app would open a UIWebView to a login page on my website, upon successful log in, the webview will be closed. There's a url I need to request which would return a very small json data. If I were to launch this url with a webview, the…
3
votes
1 answer

NSURLConnection sometimes truncates the body of an NSMutableURLRequest

I have an app on the appStore that syncs xml data to a webservice. I've had two error reports today caused by the xml document ending prematurely. One ended right in the middle of an xml tag, so I know it isn't a problem caused by special…
bgolson
  • 3,460
  • 5
  • 24
  • 41
2
votes
1 answer

NSMutableURLRequest and NSURLConnection can't work in GCD dispatch_async?

I put a NSMutableURLRequest request in dispatch_async but it doesn't work. However, NSURLRequest works. Code: dispatch_queue_t queue1 = dispatch_get_global_queue(0, 0); dispatch_async(queue1, ^{ NSMutableURLRequest* request =…
2
votes
1 answer

NSURLResponse not always receiving Data

I was wondering why in NSURLResponse in a sendSynchronousRequest would not receive information every time even though no change has occurred. It looks like there is NSData being received but it is not getting converted into a string and then not…
Rob
  • 426
  • 8
  • 23
2
votes
2 answers

NSURLConnection distinguish 2 different request

In my app I need to download and post some data... First of all I need to download some data and then I need to do a post request. I Use async request to don't freeze the UI of my app... But when I call my method to post some data... I don't care…
Usi Usi
  • 2,967
  • 5
  • 38
  • 69
2
votes
2 answers

xml parsing with Post method+iphone

I am having problem with xmlparsing with post method. API URL : http://XXX.XXX.X.XX/api/user.php Function Name : getUserList Sample XML : 0 Now i am using :- //…
ios developer
  • 3,363
  • 3
  • 51
  • 111
2
votes
2 answers

Why does my NSURLMutableRequest POST request act like a GET request?

I've got a problem with my objective c code. I have a API-key protected WCF API that I built that takes POST requests and writes them to a Java servlet with C#. Anyway, this works great when testing with Fiddler, not so good from objective C. …
jdb1a1
  • 1,045
  • 1
  • 13
  • 32
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
0 answers

JSON POST Request on the iPhone (Using HTTP) Problems

Im having problems with my request to a asp .net mvc web service. I read in a thread a while ago that its possible to find out what the server wants the the request's content-type to be etc. I get no error when compiling but when I do the actual…
Gustav Engvall
  • 135
  • 1
  • 2
  • 8