asihttprequest

iPhone ASIFormDataRequest with multipart/form-data

半世苍凉 提交于 2019-12-06 09:49:26
as I have read in the ASI Documentation , its writen: "Data is posted in 'application/x-www-form-urlencoded' format, or 'multipart/form-data' format when uploading binary data or files." That's exactly my Problem. I am sending just a String to a server, but the server just accepts 'multipart/form-data' and as I just send a String, the ASI Framework creates a POST request with 'application/x-www-form-urlencoded' format automatically, cause I am not sending any binary data or file. Result: the server does not accept my POST request. How could I solve this problem? Thanks in advance for helping.

Ad Hoc iPhone SIGSEGV crash while Debug on device & simulator works

旧巷老猫 提交于 2019-12-06 08:27:36
App crashes immediately after I attempt to login so it can’t a be a watchdog memory issue Reason: _mh_execute_header App crashes upon attempting to make a network request using ASIHTTPRequest. Request never touches server. ASIHTTPRequest: I use -fno-objc-arc to omit ASIHTTPRequest from ARC. I believe that the following call is causing my problems since my call never even touches the server when I make a request. Any help would be greatly appreciated! Call: NSDictionary *response = [[NetworkManager sharedManager] loginWithName:name password:pwd]; Method: - (NSDictionary *)loginWithName:

ASIHTTPRequest UIWebView load documents

房东的猫 提交于 2019-12-06 08:19:52
What is the best way to view documents (pdf,doc,xls) using AsiHttpRequest and UIWebView??? I tried the following, but the UIWebView is displaying the html: NSString * baseURL = @"http://xxxxxx/open-api/v1/"; NSString * itemRef = @"item/133/attachment/test.pdf"; NSString *urlString = [NSString stringWithFormat:@"%@%@", baseURL, itemRef]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setUsername:@"xx"]; [request setPassword:@"xx"]; [request startSynchronous]; NSError *error = [request error]; if (!error) { [self.webView

ASIHTTPRequest Returning HTML instead of JSON

删除回忆录丶 提交于 2019-12-06 06:30:07
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"; "Content-Encoding" = gzip; "Content-Type" = "text/html; charset=utf-8"; Date = "Tue, 05 Jul 2011 21:11:10

ASIHTTPRequest Reachability How to

混江龙づ霸主 提交于 2019-12-06 05:01:28
问题 As much as I like ASIHTTPRequest, it isn't documented anywhere how to use the modified the Reachability class, and I couldnt find it on stackoverflow, or any sample projects either. Currently im at this point: Reachability *reach = [Reachability reachabilityWithHostName:@"http://google.com"]; [reach startNotifier]; if ([reach isReachable]) { NSLog(@"connection"); }else{ NSLog(@"no connection"); } Which doesn't seem to work. 回答1: You need to set up a notification handler for this: Reachability

Incorrect NSStringEncoding value 0x0000 detected

*爱你&永不变心* 提交于 2019-12-06 05:00:24
问题 I am using ASIHttpRequest library in iphone and when i try to do a GET request on the below URL i get this message and the request fails, please anyone if he/she has encountered this problem or know a possible solution to it please let me know. Secondly if i paste the link in the browser it works perfectly fine. [URL] http://www.rugsale.com/iphone/app/?type=product_list&params=id%3D334&ver=1.0&key=kaoud [ERROR] Incorrect NSStringEncoding value 0x0000 detected. Assuming NSStringEncodingASCII.

ASIHTTPRequest crashes the app on ios8

自古美人都是妖i 提交于 2019-12-06 04:43:58
Here I am using JSON to parse the data with ASIHTTPRequest The same code is working fine for my lower version of iOS. (iOs7 & below) But I am not able to run this on my iOS-8 device. The log is getting well, but the app crashes, may be getting late reply from server. It should not crash for late reply. Does any new modification required for iOS-8 for ASIHTTPRequest ? Same code for lower version working well. If I tried to check with debugger ON with each method, I found my code is crashing right here: -(void)startSynchronous { #if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING ASI_DEBUG_LOG(@"

Download and cache entire web page on ios

别说谁变了你拦得住时间么 提交于 2019-12-05 22:02:49
I need to download an entire webPage and store it in app's documents directory and load it from the cache the next time user visits. No matter how much I search, I always end up with ASIWebPageRequest ..!! even though, it works, its very old and deprecated.So I am looking for some alternatives. Another reason I am trying to avoid it is because .... It is a completely reimplemented URL loading system, based on very low level constructs (CFNetwork). So as Apple makes improvements to their high level libraries (NSURLConnection, NSCache) ASIHTTP doesn't get those advancements. Hence, I tried this

About solution of offline mode for online HTML5 video system

◇◆丶佛笑我妖孽 提交于 2019-12-05 19:55:32
We have online website system with a lot of feature such as playback video etc. The purpose is that we want to make offline mode application for the iPad with UIWebView support. Two choices: Use HTML5 manifest to implement offline mode , here Download all content of HTML/JavaScripts/CSS and resources such as images/videos, then use UIWebView to load the HTML file For the solution 1, after searching we found a lot of problems such as cache limitation, not clear answer , 5MB ? 50 MB ? hard to control , HTML/CSS/JS files are okay, but for video etc, not stable live by session ... So we would give

ASIHttpRequest send a weired status code of zero. Not reaching the server

故事扮演 提交于 2019-12-05 16:40:31
I use ASIHTTPRequest framework in my iPhone application to manage the HTTP communication. I followed their examples given in the project home page to send asynchronous requests. There we have to implement two callbacks, one for requestFinish and other for requestFailed. However, 60% of the time requests sent by the iPhone ends up in the "requestFinish" callback method and gives a valid HTTP status code. But sometimes it goes to "requestFailed" callback and the status code become '0' which is confusing. My investigations revealed that the internet connection is ok, and I am sending the request