asihttprequest

ASIHTTPRequest build / link error

牧云@^-^@ 提交于 2019-12-20 05:13:20
问题 - (void)getFacebookProfile { NSString *urlString = [NSString stringWithFormat:@"https://graph.facebook.com/me?access_token=%@", [_accessToken stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDidFinishSelector:@selector(getFacebookProfileFinished:)]; [request setDelegate:self]; [request startAsynchronous]; } The above method (from www.raywenderlich.com)

ASIHTTPRequest, EXC_BAD_ACCESS when request did finished

二次信任 提交于 2019-12-19 09:52:58
问题 I'm trying to do an asynchronous request with ASIHTTPRequest, but have some problem getting notified when the request is done. -(void)doDownload{ NSURL *url = [NSURL URLWithString:@"http://www.someurl.com/?"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:@"someValue" forKey:@"someField"]; [request setRequestMethod:@"POST"]; [request setDelegate:self]; [request setDidFinishSelector:@selector(requestFinished)]; [request startAsynchronous]; } -

ARC and ASIHTTPRequest

两盒软妹~` 提交于 2019-12-18 10:56:06
问题 I have a strange problem. I use ASIHTTPRequest in a iOS 5 project with ARC enabled. Since ASIHTTPRequest does not support ARC I have disabled ARC on all individual ASIHTTPRequest files. However, when I'm trying to compile my project, xcode still believes that those files are ARC-enabled and it complains. Did I do anything wrong or is that a bug in xcode? Don't tell me to convert ASIHTTPRequest to ARC-compatible code with the refactor tool. I have tried to do that and xcode complains on that

Upload picture selected using UIImagePickerController

江枫思渺然 提交于 2019-12-18 09:34:19
问题 I'm trying to upload the picture selected using UIImagePickerController. The UIImagePickerController gives UIImage object that I can display in a view, but it doesn't give a path (may be it does and I'm looking at wrong place). I'm using ASIFormDataRequest to upload content, but this would need path to the picture to upload it. Any suggestion ? Thank you 回答1: If you have UIImage with you than you don't need local path for image to upload, you can upload it using following code. NSData

How to upload image that was taken from UIImagePickerController

社会主义新天地 提交于 2019-12-18 04:19:10
问题 After user choose image from the iPhone library with UIImagePickerController , I want to upload it to my server using ASIHTTPRequest library. I know that with ASIHTTPRequest I can upload a file with the file's URl, but how do I get the image URL? I know I can get the image UIImagePickerControllerReferenceURL , that look like this: "assets-library://asset/asset.JPG?id=F2829B2E-6C6B-4569-932E-7DB03FBF7763&ext=JPG" is this the URL I need to use? 回答1: There are two ways 1: You can upload the

ASIHTTPRequest - HTTPS

天大地大妈咪最大 提交于 2019-12-17 21:57:33
问题 Does ASIHTTPRequest support HTTPS connections? My connection right now works for a HTTP connection and errors if I try a HTTPS Connection. (Goes into requestFailed and gives me a ASIHTTPErrorRequestDomain) -(void) getData { av.hidden = NO; [av startAnimating]; NSString *urlString = [IP stringByAppendingString:@"Method1"]; NSURL *url = [NSURL URLWithString:urlString]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; NSLog(@"URL = %@",url); [request setRequestMethod:@"POST

AFNetworking : How to know if response is using cache or not ? 304 or 200

走远了吗. 提交于 2019-12-17 15:44:24
问题 I can't find any answer to my question, may be I miss something... When I ask for a url, I need to know if the response comes from the cache or from the net. Is the status code 304 or 200 ? (but AFNetworking always responde 200) With ASIHTTPRequest I used to check " didUseCachedResponse " from ASIHTTPRequest , this was perfect. 回答1: I think I found a solution to determine if response was returned from cache or not using AFNetworking 2.0. I found out that each time a new response is returned

what is the difference between post and get request for asihttprequest?

房东的猫 提交于 2019-12-14 03:58:48
问题 I am wondering what the difference between Get and Post with asihttprequest library.. Is this a GET? - (IBAction)sendHttpsRequest { //Set request address NSMutableString *databaseURL = [[NSMutableString alloc] initWithString:@"https://142.198.16.35"]; //call ASIHTTP delegates (Used to connect to database) NSURL *url = [NSURL URLWithString:databaseURL]; //This sets up all other request ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setDelegate:self]; [request

How to accept self-signed certificate with asihttprequest

萝らか妹 提交于 2019-12-14 00:16:54
问题 I am trying to get a self-signed certificate to work with my application. I am using the ASIHTTPRequest library at the moment like so : - (IBAction)sendHttpsRequest { //Set request address NSMutableString *databaseURL = [[NSMutableString alloc] initWithString:@"https://142.18.87.46:443"]; //call ASIHTTP delegates (Used to connect to database) NSURL *url = [NSURL URLWithString:databaseURL]; //This sets up all other request ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

Encoding issue with ASIHttpRequest

非 Y 不嫁゛ 提交于 2019-12-13 16:14:43
问题 I have an encoding problem with ASIHttpRequest. When I get an URL, the data is returned perfectly except for a little encoding problem. This is my code: - (void)fetchGamesForCategory { NSString *url_string = [[NSString alloc] initWithFormat:url_match, theCategory._id]; NSURL *url = [NSURL URLWithString:url_string]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous]; NSError *error = [request error]; if (!error) { NSString *response = [request