asihttprequest

Using authlogic with iPhone client using ASIHTTPRequest or NSURLConnection

泪湿孤枕 提交于 2019-12-10 18:58:40
问题 I am currently working on an iPhone front end for a rails service that uses vanilla authlogic for authentication. I am completely stuck on how to login to authlogic from the iPhone using ASIHTTPRequest or possibly NSURLConnection. How do I get the current user once I am already logged in? I have found many similar questions here on Stack Overflow but none of them provided good, in depth answers. Any help is greatly appreciated! 回答1: I have figured it out! Authlogic supports http basic

ASIHttpRequest ignores setValidatesSecureCertificate parameter

早过忘川 提交于 2019-12-10 15:57:20
问题 Can ASIHTTPRequest ignore 'setValidatesSecureCertificate' parameter under certain conditions ? If i do this: NSURL *url = [NSURL URLWithString:@"https://someselfsignedurl"]; ASIHTTPRequest *r = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease]; [r setValidatesSecureCertificate:YES]; [r startSynchronous]; // Should not work: NSLog(@"Result: %@", [r error] ? [[r error] description] : [r responseString]); i've got the expected behaviour, i.e. a NSError telling the certificate is self-signed

Is this the correct way of downloading a file with ASIHTTPRequest?

瘦欲@ 提交于 2019-12-10 11:57:31
问题 Is this the correct way of downloading a file with ASIHTTPRequest? As you can see, I'm trying to download the file to the documents directory and am naming Test.mov. The only part is... the file doesn't download. I'm still confused by how ASIHTTPRequest works, so all help is appreciated! -(IBAction)download { ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"https://www.chillysky.com/Test.mov"]]; NSArray *paths = NSSearchPathForDirectoriesInDomains

ASIHTTPRequest Error messages - Beginner

强颜欢笑 提交于 2019-12-10 11:48:24
问题 I am using ASIHttpRequest. I need to know what this error message means ? and how could i resolve it Request error <ASIHTTPRequest: 0xbedc00> -- Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0x270230 {NSUnderlyingError=0x250cf0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)", NSLocalizedDescription=A connection failure occurred} There are many more error messages; the above is Error Domain=ASIHTTPRequestErrorDomain Code=1

ASIHTTPRequest Returning HTML instead of JSON

人走茶凉 提交于 2019-12-10 11:23:10
问题 I am using ASIHTTPRequest to contact an API the problem is that it is returning html instead of JSON and i have no idea why. Everything has been working great for weeks and i can't seem to figure out what has broken.. What's strange is doing exactly the same request with a browser or postie returns the correct JSON response, but when i do the request via ASIHTTPRequest these are the response headers i get: "Cache-Control" = "private, max-age=0, must-revalidate"; Connection = "keep-alive";

Can an ASIHTTPRequest be retried?

有些话、适合烂在心里 提交于 2019-12-10 09:08:06
问题 Is there a way to retry an ASIHTTPRequest? I'm using custom authentication in a REST service instead of basic HTTP authentication and I would like to retry a request if the session has expired. Calling startAsynchronous a second time on a request causes an exception. I would like to do something like this: [request setCompletionBlock:^{ if ([request responseStatusCode] == 500) { // try to login again in case token expired [server loginAndRetryRequest:request]; } else { // parse response } }];

Display records of next page in json in uitableview on scrolling the tableView when I reach the last record

柔情痞子 提交于 2019-12-10 00:08:19
问题 I am trying to make an application that uses SBJSON and ASIHTTPRequest containing 273 pages (50 records in each page)in json. When I scroll the tableView I want to get next 50 records when I reach the last record.Currently I am getting only the first 50 records. How will I get all the records? I am using Xcode 6 objective c. //Here I am taking the json data on view load - (void)viewDidLoad { [super viewDidLoad]; main_array = [[NSMutableArray alloc] init]; NSURL *countryURL = [NSURL

ios的ASIHTTPRequest学习

╄→尐↘猪︶ㄣ 提交于 2019-12-09 23:12:34
目录 发起一个同步请求 创建一个异步请求 队列请求 请求队列上下文 ASINetworkQueues, 它的delegate提供更为丰富的功能 取消异步请求 安全的内存回收建议 向服务器端上传数据 下载文件 获取响应信息 获取请求进度 cookie的支持 大文件断点续传 ASIDownloadCache 设置下载缓存 多种的缓存并存 缓存策略 缓存存储方式 缓存其它特性 实现自定义的缓存 使用代理请求 ASIHTTPRequest, 请求的其它特性 ASIHTTPRequest是一款极其强劲的HTTP访问开源项目。让简单的API完成复杂的功能, 如: 异步请求,队列请求,GZIP压缩,缓存,断点续传,进度跟踪,上传文件,HTTP认证 在新的版本中,还加入了Objective-C闭包Block的支持,让我们的代码更加轻简灵活。 下面就举例说明它的 API用法 。 发起一个同步请求 同步意为着线程阻塞,在主线程中使用此方法会使应用Hang住而不响应任何用户事件。所以,在应用程序设计时,大多被用在专门的子线程增加用户体验,或用异步请求代替(下面会讲到)。 - (IBAction)grabURL:(id)sender { NSURL *url = [NSURL URLWithString:@" http://allseeing-i.com" ]; ASIHTTPRequest

iOS6 large downloads time out

廉价感情. 提交于 2019-12-09 19:24:29
问题 It seems like all large downloads timeout on iOS6 using ASIHTTPRequest. Does anybody know of any forks that have updated this library for iOS6. I love this library and really do not want to have to switch. EDIT: This issue is not specific to ASIHTTPRequest. Upon testing FSNetwork, MKNetwork, AFNetwork, and NSURLConnection they all fail. A sample project can be downloaded from here: https://github.com/BLamy/NetworkTest It must be built to an actual device running iOS6 (I used an iPad2 unsure

Incorrect NSStringEncoding value 0x0000 detected (using ASIHTTPRequest)

别来无恙 提交于 2019-12-09 08:59:02
问题 I'm using ASIHTTPRequst in my application and im having some problems, but only on certain devices. In some cases i get the following error: " Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future " I got limited options for testing this out, because it works on all my internal test devices, but the problem still occurs on one or more of my clients test phones. It may also be a case when the phone is