nsmutableurlrequest

How to download multiple mp4 file in background with progress in iOS?

穿精又带淫゛_ 提交于 2019-12-12 16:55:33
问题 I stuck from last 2 days on this issue. please help me out. My requirement is, if I downloading a file in background in second view controller and after download starting I pop to 1st view controller and If I again push to 2nd view controller then that progress should be continue. Here what happening : I push to second view controller. I started Download using NSMutableURLRequest , NSURLConnection . If I pop to 1st view controller and again go to 2nd view controller then all are showing 0.

iphone: NSMutableURLRequest returns strange characters for MS Word style apostrophe

时光毁灭记忆、已成空白 提交于 2019-12-12 11:54:49
问题 We are pulling content off our website using XML/NSMutableURLRequest and sometimes it pulls through the "curly" style apostrophe and quotes, ’ rather than '. NSMutableURLRequest seems to hate these and turns them into the strange \U00e2\U0080\U0099 string. Is there something that I can to do prevent this? I am using the GET method, so should I be somehow telling it to use UTF-8? Or, am I missing something? UIApplication* app = [UIApplication sharedApplication]; app

NSMutableURLRequest returns old values even cachePolicy is NSURLCacheStorageNotAllowed

﹥>﹥吖頭↗ 提交于 2019-12-12 03:09:54
问题 Im using codes posted here: connection release method in connectionDidFinishLoading, causes error now first execute returns didFail log. second execute; returns old response data. albeit my (localhost) server is totally offline. and cachePolicy is NSURLCacheStorageNotAllowed (check the code on the link I posted above) NSMutableURLRequest *request= [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:3.0f]; the response data seems cached somewhere and

Upload files (images, pdf) with parameters to the server

半腔热情 提交于 2019-12-12 01:48:22
问题 I would like to upload 1pdf file and array of images. I can upload 1pdf and 2jpg files, if jpg files more than two I get message: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x174268000 {NSDebugDescription=No value.} Why is this happening? Also I tested server with POSTMAN and it work well. NSURL *URL = [NSURL URLWithString:constFileUploadURL]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];

How to call a function of web service for login? [closed]

五迷三道 提交于 2019-12-11 19:16:31
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . I have a Web-Service API in PHP and i want to do login using this api in my ios application. if (isset($_POST['tag']) && $_POST['tag'] != '') { // Get tag $tag = $_POST['tag']; // Include Database handler require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // response Array $response

Swift: How to add Dictionary format in forHTTPHeaderField in GET request

拟墨画扇 提交于 2019-12-11 15:59:11
问题 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 let getMenuURL = service_url + "/MyPage/FileDownload.ashx" var convertedString = "" do { let data1 = try JSONSerialization.data(withJSONObject: WebService.sharedManager().mobInfoDict, options: []) convertedString = String(data: data1, encoding: .utf8)!

How to send HTTP POST request to PHP service with Objective-C

試著忘記壹切 提交于 2019-12-11 14:27:05
问题 Im trying to post to php and get the response. The php file has an echo "hello" which should just print hello. I'm trying to test to see if posting is working but in my error log the NSlog doesn't display anything: @interface ViewController () @end @implementation ViewController @synthesize email, password,receivedData; -(IBAction)Login:(id)sender{ // Create the request. NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://grouporder.site90.net/test

How to POST question mark to a web service? Objective-c

淺唱寂寞╮ 提交于 2019-12-11 14:25:57
问题 Previously, I was having a problem in posting special characters to web service. But now, I can POST all special characters except "?" which I do not understand why. NSString+URLEndoding.h @interface NSString (NSString_URLEncoding) //originally NSOBject - (NSString *)urlEncodeUsingEncoding:(CFStringEncoding)encoding; - (NSString *)urlEncode; @end NSString+URLEndoding.m @implementation NSString (NSString_URLEncoding) - (NSString *)urlEncodeUsingEncoding:(CFStringEncoding)encoding { return

Error Domain = NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)

岁酱吖の 提交于 2019-12-11 09:07:54
问题 I am requesting dynamic json string from web url. -(void)getDataFromServer{ NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.domain.com/json/"]]; [request setHTTPMethod:@"GET"]; [request addValue:@"getValues" forHTTPHeaderField:@"METHOD"]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; } -(void)requestReturnedData:(NSData *)data{ //activated when data is returned NSDictionary *dictionary =

Pipes in NSString fetched by NSMutableURLRequest

瘦欲@ 提交于 2019-12-11 07:35:31
问题 I have the following method to get the content of a file called parsertest.html from a webserver. However about one every 5 times i run my program, the fetched NSString contains a line of pipes at the end |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Here is my code: -(NSString *)fetchTest { NSURL* url = [NSURL URLWithString:@"http://www.mywebserver.com/parsertest.html"]; NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url]; [request setValue