nsurlrequest

Domain=NSURLErrorDomain Code=-1001 “The operation couldn’t be completed. (NSURLErrorDomain error -1001.)”

妖精的绣舞 提交于 2019-12-09 20:11:20
问题 my program is write for upload the picture from the cam,sample code below: #define WEBSERVICE_URL @"http://192.168.0.104/upload.php" - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissViewControllerAnimated:YES completion:^{ UIImage *selectedImage = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *imageData = UIImagePNGRepresentation(selectedImage); NSMutableURLRequest *request = [

NSURLRequest, why does craigslist return a 404?

南笙酒味 提交于 2019-12-09 20:08:55
问题 I'm building my first iPhone app and I'm stymied. I'm trying to build an RSS reader, and I'm trying to use a feed from craigslist. This code, using stackoverflow, returns "Status code: 200": - (void)parseRSSFeed:(NSString *)feed withDelegate:(id)delegate { responseData = [[NSMutableData data] retain]; feed = @"http://stackoverflow.com"; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:feed]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } - (void

NSURLRequest to NSString

不羁的心 提交于 2019-12-09 14:18:34
问题 how can i convert NSURLRequest to NSString ? 回答1: Depends on the information you want in the string. Do you want to have it contain all the values of the instance variables in the object? If so, you're going to need to write your own method that does that. Perhaps subclass NSURLRequest and override description . You could also use reflection to get at all the private ivars and print everything out from another class. Or just use a debugger to inspect the values. 回答2: - (NSString*)

How to query the last modification date of a file via HTTP on the iPhone using NSHTTPURLResponse?

白昼怎懂夜的黑 提交于 2019-12-09 06:11:02
问题 In my iPhone application I need to query the last modification date of an internet .m4a file via HTTP , but I DON'T want to downloading it. I'm reading Apple's documentation about NSURLRequest and NSHTTPURLResponse , but it seems to be all related to downloading the file and not querying it first. Maybe I'm wrong. How can I know the last modification date of a .m4a file, via HTTP , WITHOUT downloading it? Thanks! 回答1: This answer assumes your server supports it, but what you do is send a

How can I wait for a NSURLConnection delegate to finish before executing the next statement?

不羁岁月 提交于 2019-12-09 03:25:02
问题 This has been a hard one to search. I found a similar question, iOS 5 Wait for delegate to finish before populating a table?, but the accepted answer was 'Refresh the table view,' and that does not help me. The other results I found tended to be in c#. I have an app that streams from iPhone to Wowza servers. When the user hits record, I generate a unique device id, then send it to a PHP script on the server that returns a JSON document with configuration settings (which includes the rtmp dump

NSURLConnection, NSURLRequest, untrusted cert and user authentication

北慕城南 提交于 2019-12-09 03:06:40
问题 Morning Everyone, I've been attempting to write an application that does some GETs from a remote Web Service that requires authentication. My main problem is that the majority of these remote servers (and there are a lot of them) don't have valid certificates. I've got code to accept the invalid certificate and code to respond to the challenge with the correct uname & pass (below). The problem I'm having is getting the two to play together. I can't seem to find a way to send the challenge

lock screen interrupts NSURLConnection

空扰寡人 提交于 2019-12-08 23:56:32
问题 I'd like to know what's happening behind the scenes when the user locks and unlocks the iPad screen. I have an app that downloads files using NSURLConnection and the downloads fail with a SOAP error ("A server with the specified hostname could not be found"), but not when the user locks the screen, but when it unlocks it. Regardless of the fact when the error pops up, the download never finishes. Any ideas why and what could be done about it ? NSMutableURLRequest* request =

iOS Twitter NSURLErrorDomain Code=-1012

放肆的年华 提交于 2019-12-08 16:41:25
问题 I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error : Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token,

how to ignore self-signing certificate with NSURLRequest

爱⌒轻易说出口 提交于 2019-12-08 07:44:26
问题 I need help with trying to bypass/ignor a self signing certificate.. I have looked everywhere and cannot find anything that has worked for me thus far.. I am trying to implements this here however im not sure how to use this code @implementation NSURLRequest(AllowAllCerts) + (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *) host { return YES; } @end I add it to my app delegate but then I dont know what to do with it? any help would be greatly appreciated.. currently I am not using anything

how to ignore self-signing certificate with NSURLRequest

一世执手 提交于 2019-12-08 06:33:24
I need help with trying to bypass/ignor a self signing certificate.. I have looked everywhere and cannot find anything that has worked for me thus far.. I am trying to implements this here however im not sure how to use this code @implementation NSURLRequest(AllowAllCerts) + (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *) host { return YES; } @end I add it to my app delegate but then I dont know what to do with it? any help would be greatly appreciated.. currently I am not using anything because nothing has worked for me.. This is how I got it to work. I added these two methods just below