asihttprequest

ASIHttpRequest POST

牧云@^-^@ 提交于 2019-12-24 15:16:10
问题 I am working on an iphone app and my requirements are to make a simple post to a web service and the web service returns a json response. The sample code they give for a post is this, but how do I get a response? I see there is asynchronous code for doing a get, but how do I do it async for a post? ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request addPostValue:@"Ben" forKey:@"names"]; [request addPostValue:@"George" forKey:@"names"]; 回答1: If you're targeting iOS

Read status line (status code and reason phrase) using AFNetworking's AFHTTPRequestOperation

拟墨画扇 提交于 2019-12-24 10:56:57
问题 I am switching from ASIHTTPRequest to AFNetworking in an iOS application. RF2616 (HTTP/1.1) defines a "status-line" by the combination of "Status Code" and "Reason Phrase". Sometimes the server adds some specific information in this "Reason Phrase" and I found it rather handy that ASIHTTPRequest allowed me to access it easily via ASIHTTPRequest *request = ...; NSString *reason = request.responseStatusMessage; My problem is that I can't find any way to do it with AFHTTPRequestOperation

how to find and fix the cause of the crash

倾然丶 夕夏残阳落幕 提交于 2019-12-24 08:57:04
问题 I submited an app to the app store and it was rejected due to: "We found that your app crashed on iPhone 5 running iOS 6.1.2, which is not in compliance with the App Store Review Guidelines. Your app crashed when we: when the user taps to sign into the app, a crash is produced. This occurred when your app was used: On Wi-Fi On cellular network Your app may encounter this issue if it is using too much memory. To learn more about iOS memory usage and how to track memory usage and leaks, please

How to create folder on Amazon S3 using objective-c

只谈情不闲聊 提交于 2019-12-24 07:41:02
问题 I know this is a question that may have been asked before (at least in Python), but I am still struggling to get this right. I compare my local folder structure and content with what I have stored in my Amazon S3 bucket. The directories not exisiting on S3, but which are found locally, are to be created in my S3 bucket. It seems that Amazon S3 does not have the concept of a folder, but rather a folder is identified as an empty file of size 0. My question is, how can I easily create a folder

Timer vs ASIHTTPRequest - find optimal solution

蓝咒 提交于 2019-12-23 04:28:26
问题 The code is shown as below, I have a button once you click it activates timer and timer calls method every 4sec. However, sometimes 4 sec is not enough for server to return the data. However, increasing the timer value is not also good solution if server returns data in 1 sec and would not good for user to wait longer. I do not know what is best/optimal solution in this case. -(IBAction)play:(id)sender{ timer=[NSTimer scheculedWith TimerInterval(4.0) target:(self)selector:@selector

How do I detect a HTTP response, parse the xml and save to a NSString?

邮差的信 提交于 2019-12-23 02:56:08
问题 I've been trying to figure this out for weeks and i still get nothing. I am using the ASIHTTPRequest and ive successfully sent the data to a server and now I need to get the response XML,parse it and save the elements to each labeled NSString so I can post it to the server. Does anyone have an idea on how to do this? 回答1: From looking at the How to Use page, I think what you want to do is implement methods that can be called when the request is complete. For example, say you have a method

ASIHTTPRequest and background

杀马特。学长 韩版系。学妹 提交于 2019-12-23 01:51:01
问题 Wat happen when we start a request and we enter the background before the request is finished ? Do we have to cancel it ? What is the right way to do so ? PS : i don't want my download to continue when the user enter background. Thanks, 回答1: From the documentation you will see that to continue a request in the background, you need to specifically request that action using; [request setShouldContinueWhenAppEntersBackground:YES]; The corollary is that if you don't specifically enable it, the

Maintaining session in after closing UIWebView

别等时光非礼了梦想. 提交于 2019-12-23 00:52:32
问题 I have an application which has a login page resides on the application server. So I open a UIWebView to handle the login. After then I want to switch to the UIView and make API calls using ASIHttp library (others may also be acceptable). The problem is; after I login server keeps session object for authentication purpose, so when I close the UIWebView and switch to a UIView and make an API call, it fails. I believe, somehow I need to maintain session object (set after login) in the API calls

Execute Javascript without using a browser

点点圈 提交于 2019-12-22 18:37:17
问题 In an application I'm working on, I am downloading a webpage of mine from the server and then parsing the code for information. I'm using an ASIHTTPRequest to get the code from the server. The problem is that the webpage uses Javascript to set some text on the page, and the ASIHTTPRequest pulls the code from the server, so the Javascript never gets executed, and therefore the webpage is missing information. Is there an easy way to execute the Javascript without a browser so as to let it

Execute Javascript without using a browser

本小妞迷上赌 提交于 2019-12-22 18:37:02
问题 In an application I'm working on, I am downloading a webpage of mine from the server and then parsing the code for information. I'm using an ASIHTTPRequest to get the code from the server. The problem is that the webpage uses Javascript to set some text on the page, and the ASIHTTPRequest pulls the code from the server, so the Javascript never gets executed, and therefore the webpage is missing information. Is there an easy way to execute the Javascript without a browser so as to let it