asihttprequest

AFNetworking - How to setup requests to be retried in the event of a timeout?

喜欢而已 提交于 2019-11-28 15:49:17
I have recently migrated from ASIHTTPRequest to AFNetworking, which has been great. However, the server that I am connecting with has some issues and sometimes causes my requests to timeout. When using ASIHTTPRequest it was possible to setup a retry count on a request in the event of a timeout using the following selector -setNumberOfTimesToRetryOnTimeout: This can be further referenced in this post, Can an ASIHTTPRequest be retried? This is AFNetworking if you are unfamiliar https://github.com/AFNetworking/AFNetworking#readme I was unable to find an equivalent api in AFNetworking, has anyone

Use a self-signed ssl certificate in an iphone app

扶醉桌前 提交于 2019-11-28 15:15:16
I apologize in advance for the long-winded question. I'm having trouble with a self-signed SSL cert and I want to document everything I've tried so far. I'm working on an app that communicates with a REST service. The test server uses a self-signed ssl certificate that I can install on my computer without issue. It's a .p12 file that requires a password to install. Without this certificate installed, all requests to the server return a 403. The .p12 installs three items in the Keychain, a "Root certificate authority", a "test user" certificate that's issued by the "Root certificate authority",

Best architecture for an iOS application that makes many network requests?

∥☆過路亽.° 提交于 2019-11-28 14:56:28
I'm in the process of rethinking my approach to the request architecture of a large app I'm developing. I'm currently using ASIHTTPRequest to actually make requests, but since I need many different types of requests as a result of many different actions taken in different view controllers, I'm trying to work out the best system of organizing these requests. I'm currently building singleton "requesters" that are retained by the app delegate and sit around listening for NSNotifications that signal a request needs to be made; they make the request, listen for the response, and send out a new

ASIHTTPRequest begins but never ends

[亡魂溺海] 提交于 2019-11-28 09:18:29
问题 I have used ASIHTTPRequest a thousand times. This times is no different or special, but... when I start a request in the simulator (iOS 5.0) all is fine, when I start one on the iPad connected during development all is fine, but when I burn an AdHoc build and load it onto the iPad, this one particular ASIHTTPRequest starts, but never completes or fails. Well, I presume it is starting. Any ideas? BTW, the same app uses ASIHTTPRequest is several other places, and all work fine. 回答1: Apparently

ASIHTTPRequest post json to php server

帅比萌擦擦* 提交于 2019-11-28 07:47:33
I have been trying to post a json object to a PHP script for the last 5 hours. I have read all the docs and it seems the code should work BUT it does not. The request is made and received ok, but I can't access the posted json data or dont even know if its been sent correctly. I keep getting an empty php array, instead of the json data. NSString *jsonString = [self.tableDataSource JSONRepresentation]; NSURL *url = [NSURL URLWithString:@"http://myserver.com/test.php"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request addRequestHeader:@"User-Agent" value:@"ASIHTTPRequest"]

ASIHTTPRequest / ASIFormDataRequest - referencing request object within blocks under ARC

南笙酒味 提交于 2019-11-28 06:24:33
Very similar to this question , I am trying to convert a project that uses ASIHTTPRequest & ASIFormDataRequest to ARC. In my view controller classes, I often refer to and use properties of the request object in the completion blocks (looking at the response code, response data etc): __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:SOME_URL]]; [request setCompletionBlock:^{ if([request responseStatusCode] == 200) ....etc When converting to ARC I get the warning: Capturing 'request' strongly in this block is likely to lead to a retain cycle What is

Why are my ASIHTTPRequest files showing ARC errors?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 05:34:07
I have implemented all of my ASIHTTPRequest files, but unfortunately the following errors occur: Why is this happening? JosephH ASIHTTPRequest doesn't support ARC, so it is expected you get errors if you use it in an project with ARC enabled. There are various solutions on how to disable ARC just for the asihttprequest files suggested here: https://github.com/pokeb/asi-http-request/issues/210 The easiest one is just to disable ARC for the ASIHTTPRequest source files, see here : How can I disable ARC for a single file in a project? Someone has started what they called an ARC compliant

ASIHTTPRequest: https with SSL

二次信任 提交于 2019-11-28 04:43:04
How to implement a https connection with SSL and ASIHTTPRequest ? Are there some special steps to do? Can it be that this has nothing to do with ASIHTTPRequest ? It has to do only with the server-side I think. Can someone post a link or describe the process of how a https connection can be established? This is what I found out so far: I read somewhere that you need a "real" SSL certificate and not a self signed one. There are also not all provider of SSL certificates supported I think (read this ). You also have to run through the U.S. Government requirement for a CCATS review and approval.

UILabel text not being updated

老子叫甜甜 提交于 2019-11-28 04:07:26
I am unable to change the UILabel text. The code for the the UILabel inside viewDidLoad is : startLabel=[[UILabel alloc] initWithFrame:CGRectMake(75, 395, 200, 30)]; startLabel.text=@"Recording Sound ..."; startLabel.backgroundColor=[UIColor clearColor]; startLabel.textColor=[UIColor whiteColor]; startLabel.font=[UIFont boldSystemFontOfSize:17]; [self.view addSubview:startLabel]; Later, if I want to change the label of the text with the following code, its not changing on the app : startLabel.text=@"Searching Database ..."; or [startLabel setText:@"Searching Database ..."]; The UILabel is not

How to Using ASIHTTPRequest to tracking Upload/Download progress

守給你的承諾、 提交于 2019-11-28 04:05:48
问题 I got some question is using ASIHTTPRequest to tracking Upload/Download progress This is the sample from ASIHTTPRequest website ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDownloadProgressDelegate:myProgressIndicator]; [request startSynchronous]; NSLog(@"Max: %f, Value: %f", [myProgressIndicator maxValue],[myProgressIndicator doubleValue] It says : myProgressIndicator is an NSProgressIndicator. But it looks like Apple deprecated NSProgressIndicator Check Here So