asihttprequest

Using ASIHTTPRequest's Reachability

时光怂恿深爱的人放手 提交于 2019-12-11 20:08:45
问题 I'm begin to use Reachability in my iOS project to test if there's internet connection or not. My app consists in a UITabBarController with 3 different tabs. Each tab's root is a different UIViewController . In each controller I make several requests relying on user's actions. My question is how to create a global function (or a macro) to use before each function that uses internet connection without rewriting this function in every controller. Is possible to have a function that does this? I

Iphone> Uploading UIImage object to server via ASIHTTPRequest, photo name?

馋奶兔 提交于 2019-12-11 19:46:33
问题 I got a UIImage object with no name. (but when I save UIImage to my photo library it gets a name like IMG_00000.jpg) I just don't know how to use this name for request parameter. (or whatever name it is...) That should be like, `[request addData:imageData withFileName:@"%@.jpg", self.IDON'TGETIT]` what can I use for name of this UIImage? How can I make it? (property? is there protocol or something?) 回答1: try: NSData *imageData = UIImagePNGRepresentation(yourUIImage); [request setData

Pass Result of ASIHTTPRequest “requestFinished” Back to Originating Method

前提是你 提交于 2019-12-11 18:45:57
问题 I have a method (getAllTeams:) that initiates an HTTP request using the ASIHTTPRequest library. NSURL *httpURL = [[[NSURL alloc] initWithString:@"/api/teams" relativeToURL:webServiceURL] autorelease]; ASIHTTPRequest *request = [[[ASIHTTPRequest alloc] initWithURL:httpURL] autorelease]; [request setDelegate:self]; [request startAsynchronous]; What I'd like to be able to do is call [WebService getAllTeams] and have it return the results in an NSArray. At the moment, getAllTeams doesn't return

Why won't my server accept files larger then 2MB?

ぃ、小莉子 提交于 2019-12-11 18:27:50
问题 I have a VPS that runs XAMPP and gives service to an iPhone App that I made. I used ASIHTTPRequest to upload files to the server. The App sends files to the server, and the server accept only those who are lighter then 2MB. I also checked with Wireshark and found this warning: PHP Fatal error: Maximum execution time of 60 seconds exceeded in c:/xxx/index.php in line 2 in line 2 I wrote: session_start(); in my theory they are 2 things that block big files from entering my server: Some kind of

ASIHTTPRequest 400 bad request (soap)

无人久伴 提交于 2019-12-11 18:11:49
问题 I am using ASIHTTPRequest in IOS. I have aloso a wsdl/soap web services. when i call my web serives, i got the error 400 bad request. i am using this code : NSData *xmlData = // I construct the soap message witk soapui NSURL *url = [NSURL URLWithString:@"https:myUrlWSDL"]; self.currentRequest = [ASIFormDataRequest requestWithURL:url]; [self.currentRequest appendPostData:xmlData]; [self.currentRequest setDelegate:self]; [self.currentRequest startAsynchronous]; [[currentRequest requestHeaders]

Return Value of method using AsiHTTPRequest

好久不见. 提交于 2019-12-11 17:33:36
问题 I have a class that uses AsiHTTPRequest. I want to make a method like this: -(NSData*)downloadImageFrom: (NSString*)urlString; { // Set reponse data to nil for this request in the dictionary NSMutableData *responseData = [[NSMutableData alloc] init]; [responseDataForUrl setValue:responseData forKey:urlString]; // Make the request NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [responseDataForUrl setValue:responseData forKey:

ASIHttpRequest problems. “unrecognized selector sent to instance”

南楼画角 提交于 2019-12-11 15:29:50
问题 I am experiencing problems using ASIHttpRequst. This is the error I get: 2010-04-11 20:47:08.176 citybikesPlus[5885:207] *** -[CALayer rackDone:]: unrecognized selector sent to instance 0x464a890 2010-04-11 20:47:08.176 citybikesPlus[5885:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[CALayer rackDone:]: unrecognized selector sent to instance 0x464a890' 2010-04-11 20:47:08.176 citybikesPlus[5885:207] Stack: ( 33936475, 2546353417, 34318395,

Corrupted image when uploading in background

試著忘記壹切 提交于 2019-12-11 15:22:19
问题 I'm developping a little image sharing app for my company. Everything works pretty fine except for one thing : when I upload an image to the server, and switch the app to background, a part of the image is corrupted (all gray). It seems that the image data is sent correctly as long as the app is live. As soon as I switch to background, it sends nothing as it seems. For the record, I use ASIHttpRequest, the shouldContinueWhenAppEntersBackground is set to YES and I'm running the app from iOS 4

ASIHTTPRequest addRequestHeader issue

我怕爱的太早我们不能终老 提交于 2019-12-11 13:39:44
问题 I am using ASIHttpRequest and make use GET method to send header to server. I call method addRequestHeader like this ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request addRequestHeader:@"myHeader" value:@"abc"]; It's not working. But if I use NSMutableURLRequest to add header and request to server, it works. I don't know anything wrong when calling addRequestHeader methods for ASIHTTPRequest library. Have anyone seen this issue? 回答1: Wow ok so, yeah if this is a new app,

ASIHTTPRequest Post request fails while works via HTTPClient

血红的双手。 提交于 2019-12-11 10:01:52
问题 As stated in title, I send a POST request using ASIHTTPRequest and it fails, but the same POST request works in HTTPClient , am I doing something wrong? - (void)postData:(NSData *)postData { //... NSMutableData *mutableData = [postData.mutableCopy autorelease]; [request setRequestMethod:@"POST"]; [request setPostBody:mutableData]; [request setPostLength:mutableData.length]; //.... } 回答1: That's not quite enough in all cases, at least I also had to add the correct Content-Type header to the