Search Results

Search found 65 results on 3 pages for 'asihttprequest'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Setting an ASIHTTPRequest post to a SimpleHTTPServer Python server?

    - by Rob
    I am working on a project (that i will not be releasing to the app store - just for fun) that will upload an image via an HTTP Post request from my iPhone to a server that I have running the Python script SimpleHTTPServer. I have successfully used the ASIHTTP APIs in the past for text strings, but can't for the life of me figure out how to upload an image. I have tried all of the following: NSString *path = [[NSBundle mainBundle] pathForResource:@"Image" ofType:@".png"]; [request setFile:@"Image.png" forKey:@"file"]; [request setFile:path forKey:@"file"]; [request setFile:path withFileName:@"Image.png" andContentType:@"image/jpeg" forKey:@"file"]; [request setData:[UIImage imageNamed:@"Image.png"] withFileName:@"Image.png" andContentType:@"Image" forKey:@"file"]; Any thoughts on where i could be going wrong?

    Read the article

  • read http header info in ASIHttpRequest asynchronous

    - by user262325
    Hello everyone One of my project is to download several large size files using ASIHTTPRequest in asynchronous mode. I hope to read the http returned header info to get the size of files. I know [request respsonseHeaders] (requestFinished: delegate method ) can do that. I tested and found that requestFinished: is only triggered when it completed the download of a whole single file. But I hope to access the function [request respsonseHeaders] before ASIHTTPRequest starting to download files (just when ASIHTTPRequest got the returned header info). I can not find the triggered event for this. Welcome any comment Thanks interdev

    Read the article

  • cancel an ASIHTTPRequest thread

    - by user262325
    Hello evryone I have some codes to use ASINetworkQueue as multi thread download ASINetworkQueue *networkQueue; NSURL *url = [NSURL URLWithString:s]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [networkQueue addOperation:request]; [networkQueue go]; if I try to use the code below to cancel the thread with index k [[[networkQueue operations] objectAtIndex:k] cancel]; I notice all requests in ASINetworkQueue were cancelled and stop working. Welcome any comment Thanks interdev

    Read the article

  • cancel a ASIHTTPRequest thread

    - by user262325
    Hello evryone I have some codes to use ASINetworkQueue as multi thread download ASINetworkQueue *networkQueue; [networkQueue setDelegate:self]; [networkQueue setRequestDidFinishSelector:@selector(requestDone:)]; [networkQueue setShowAccurateProgress:true]; NSURL *url = [NSURL URLWithString:s]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDownloadProgressDelegate:a]; [request setTag:index]; [request setTimeOutSeconds:10]; [request setDelegate:self]; [networkQueue addOperation:request]; [networkQueue go]; if I try to use the code below to cancel the thread with index k [[[networkQueue operations] objectAtIndex:k] cancel]; I notice all requests in ASINetworkQueue were cancelled and stop working. Welcome any comment Thanks interdev

    Read the article

  • NSNotificationCenter and ASIHTTPRequest

    - by user262325
    Hello everyone: I hope to get the http header info(file size) in asynchronous mode. So I initialize as codes: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(processReadResponseHeaders:) name:@"readResponseHeaders" object:nil]; my codes to read the http header -(void)processReadResponseHeaders: (ASIHTTPRequest *)request ;//(id)sender; { unsigned long long contentLength = [request contentLength]; //error occurs here } It has to change the source code of ASIHTTPRequest.m I did add my codes in function readResponseHeaders to notify the event is triggered ) - (void)readResponseHeaders { //......................... [[NSNotificationCenter defaultCenter] postNotificationName:@"readResponseHeaders" object:self];// } the log file reports: 2010-05-15 13:47:38.034 myapp[2187:6a63] * -[NSConcreteNotification contentLength]: unrecognized selector sent to instance 0x46e5bb0 Welcome any comment Thanks interdev

    Read the article

  • Using ASIHTTPRequest to download a file with Cocoa/MacRuby

    - by arbales
    I'm still trying to get a handle on Cocoa (both in Obj-C and MacRuby), and I'd really appreciate seeing how to download a file with ASIHTTPRequest (or without it) and MacRuby. Ideally, I'd like to be able show the progress inside a progress bar too. Must use a cocoa method for downloading, since open-uri in MacRuby is borken. Thanks for your help.

    Read the article

  • Memory management, and async operations: when does an object become nil?

    - by Kenny Winker
    I have a view that will be displaying downloaded images and text. I'd like to handle all the downloading asynchronously using ASIHTTPRequest, but I'm not sure how to go about notifying the view when downloads are finished... If I pass my view controller as the delegate of the ASIHTTPRequest, and then my view is destroyed (user navigates away) will it fail gracefully when it tries to message my view controller because the delegate is now nil? i.e. if i do this: UIViewController *myvc = [[UIViewController alloc] init]; request.delegate = myvc; [myvc release]; Do myvc, and request.delegate now == a pointer to nil? This is the problem with being self-taught... I'm kinda fuzzy on some basic concepts. Other ideas of how to handle this are welcome.

    Read the article

  • iOS 5 Hanging on ASIHTTPRequests

    - by Tareq
    So I have an app that runs on iOS 3.2 - 4.x. It uses ASIHTTPRequest to make all the REST API calls. Ever since my team and I upgraded three of our iPhone 4's to iOS 5, The app will hang and show the ActivityIndicator indefinitely. I looked at the server logs and the requests aren't hitting the server. However, if I press the iPhone home button then open the app again, the request will go through and I will receive the data, business as normal. For some reason the requests are never triggered until I reopen the app. Another weird tidbit, the app works in Xcode 4.2 and the iPhone simulator. The app also works on an iPad2 with iOS 5 (the app is iPhone only). Would this be an ASIHTTPRequest issue? Not too sure how to pinpoint the issue since there is no crash and only happens on the phone. Any insight would be much appreciated! Thanks.

    Read the article

  • Delete/move a UITableView row that's attached to a web service.

    - by Kevin L.
    Deleting or moving rows for a UITableView that is backed with local data (e.g., NSArray) is easy and instantaneous: Remove the value from the array. Call deleteRowsAtIndexPaths:withRowAnimation:. Profit! But my table view communicates with a web service, which means once the "Delete" button on that row gets tapped, I have to forward a request on to the server (via ASIHTTPRequest, of course), get the response, and then tell the table view to run its little delete-row animation, all with a few seconds of latency in between. From a high-level, what's the best way to do that? Throw some callback selector into ASIHTTPRequest's userInfo dictionary? KVO? Bonus points for some nice UI touch, like some kind of spinner on the soon-to-be-deleted cell.

    Read the article

  • not saving when using setDidReceiveDataSelector

    - by coder4xc
    i want to download a file and show the progress bar i was able to do this. now , i want to show the progress value in a label and use this code to progress init and update label : [queue setDelegate:self]; [queue setRequestDidFinishSelector:@selector(updateLabel)]; [queue setDownloadProgressDelegate:progress]; [queue setShowAccurateProgress:YES]; ASIHTTPRequest *request; request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request setTemporaryFileDownloadPath:[filePath stringByAppendingString:@".download"]]; [request setAllowResumeForFileDownloads:YES]; [request setDidFinishSelector:@selector(updateLabel)]; [request setDidReceiveDataSelector:@selector(updateLabel)]; [request setShouldContinueWhenAppEntersBackground:YES]; [request setShouldAttemptPersistentConnection:NO]; [request setDownloadDestinationPath:filePath]; [queue addOperation:request]; [queue go]; but not save in the destination path ! and when i clear this code :  [request setDidReceiveDataSelector:@selector(updateLabel)]; saving done ! what is problem ? i want to update label text when progress value changed

    Read the article

  • How to verify that post to website is coming from a specific purchased iPhone application?

    - by wgpubs
    I have an iPhone application that posts data to a web application ... and I want to only accept data posted from an iPhone application that was purchased from the iTunes store. Is there a way to do this? Is there something (or somethings) I can pass from the iPhone app to the web application that I can use to do such verification? Thanks much btw, using the asihttprequest library to handle requests/responses.

    Read the article

  • upload data and save it using ASIHTTP

    - by Srt
    I have a web page in which a value 'A' is constantly updated. I use ASIHttp to access the page contents and get this value 'A'. Based on A i calculate value X and i then i need to save this X to a webpage. I am able to get the data and am doing the calculation to get X. How do i upload and save the X to a webpage using ASIHTTP so that the X value can be used later. Thanks in advance.

    Read the article

  • How can I add HTTP request caching to an application using ASIHTTPRequests?

    - by smokey_the_bear
    I'm using ASIHttpRequests and an ASINetworkQueue in an iphone app to retrieve some 100k XML files and a lot of thumbnails from a web service. I'd like to cache the requests in the style of NSURLCache. ASI doesn't seem to support caching as is, and I looked at the code and it drops to C to create the requests, so inserting the NSURLCache layer seemed tricky. What's the best way to implement this?

    Read the article

  • How to write my own download manager using Objective C for iOS devices

    - by Saurabh
    I am writing a download manager for iPhone using objective C. I am using ASIHTTP framework and its working great. But my problem is I am not able to download from file sharing sites like filesonic, rapidshare, hotfile etc. I want to know how can I get download (actual download) url from these sites, or at least how these sites are hiding this info (and where), so I can get that somehow... Is there any open source library or framework to help me with this? How firefox or other desktop browser get this link? Any help will be much appreciated! Update 1 : I don't want to bypass their advertising and revenue streams. Almost all file sharing companies also provide free downloads with low bandwidth, I only want to use that service. there are many download managers available now for iPhone like - "Downloads Lite". I just want to build a similar functionality.

    Read the article

  • Urban Airship Tags issue

    - by Moshe
    I modified the alias sample code from: [request addRequestHeader: @"Content-Type" value: @"application/json"]; [request appendPostData:[[NSString stringWithFormat: @"{\"alias\": \"%@\"}", self.deviceAlias] dataUsingEncoding:NSUTF8StringEncoding]]; to: [request addRequestHeader: @"Content-Type" value: @"application/json"]; [request appendPostData:[[NSString stringWithFormat: @"{\"tags\": \"%@\"}", offsetStr] dataUsingEncoding:NSUTF8StringEncoding]]; offsetStr is a string containing a Timezone offset (which can be any number between -12 and 12). For some reason, Urban Airship is making each character of the string into its own tag. I've tried to substitute the - for a string neg with the same results. What's wrong?

    Read the article

  • Iphone: Need release using ASIFormDataRequest

    - by xger86x
    Hi, i have one simple question, if i'm using ASIFormDataRequest when i need to release the request object? NSURL *url = [NSURL URLWithString:@"url"]; ASIFormDataRequest *requestForm = [ASIFormDataRequest requestWithURL:url]; [requestForm addPostValue:[[NSUserDefaults standardUserDefaults] stringForKey:@"user"] forKey:@"user"]; [requestForm setRequestMethod:@"POST"]; [requestForm setDelegate:self]; [requestForm startAsynchronous]; Thanks

    Read the article

  • how to get the http header in asynchronous request mode using ASIHHTTP

    - by user262325
    Hello everyone I hope to display the download file size by reading http header. I know there is way do this: ASIHTTPRequest request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous]; NSString poweredBy = [[request responseHeaders] objectForKey:@"X-Powered-By"]; NSString *contentType = [[request responseHeaders] objectForKey:@"Content-Type"]; but this is Synchronous mode, in Asynchronous mode it can be done as below: (void)requestFinished:(ASIHTTPRequest *)request { unsigned long long contentLength = [request contentLength]; } but 'requestFinished' is at the end of download. Is there an event to get the http header info at the beginning of download? Thank interdev

    Read the article

  • how to deal with HTTPS connection in iphone

    - by pnilangekar
    please provide any example or tutorial for the same. I have used SetallowsAnyHTTPSCertificateForHost But it is private API and apple will reject app for it. I have tried to use ASIHTTPRequest but not reaching to final solution. have anyone tried using ASIHTTPRequest with https type url

    Read the article

  • 401 Unauthorized returned on GET request (https) with correct credentials

    - by Johnny Grass
    I am trying to login to my web app using HttpWebRequest but I keep getting the following error: System.Net.WebException: The remote server returned an error: (401) Unauthorized. Fiddler has the following output: Result Protocol Host URL 200 HTTP CONNECT mysite.com:443 302 HTTPS mysite.com /auth 401 HTTP mysite.com /auth This is what I'm doing: // to ignore SSL certificate errors public bool AcceptAllCertifications(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return true; } try { // request Uri uri = new Uri("https://mysite.com/auth"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri) as HttpWebRequest; request.Accept = "application/xml"; // authentication string user = "user"; string pwd = "secret"; string auth = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(user + ":" + pwd)); request.Headers.Add("Authorization", auth); ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications); // response. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Display Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); Console.WriteLine(responseFromServer); // Cleanup reader.Close(); dataStream.Close(); response.Close(); } catch (WebException webEx) { Console.Write(webEx.ToString()); } I am able to log in to the same site with no problem using ASIHTTPRequest in a Mac app like this: NSURL *login_url = [NSURL URLWithString:@"https://mysite.com/auth"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:login_url]; [request setDelegate:self]; [request setUsername:name]; [request setPassword:pwd]; [request setRequestMethod:@"GET"]; [request addRequestHeader:@"Accept" value:@"application/xml"]; [request startAsynchronous];

    Read the article

  • ASIHTTP: addOperation when other threads are running

    - by user262325
    Hello everyone I have a project using ASIHTTP to multi download files from a site when I add a new request: [networkQueue cancelAllOperations]; [networkQueue setDownloadProgressDelegate:a]; [networkQueue setDelegate:self]; [networkQueue setRequestDidFinishSelector:@selector(requestDone:)]; NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; [networkQueue addOperation:request]; [networkQueue go]; it reported: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[ASINetworkQueue addOperation:]: operation is executing and cannot be enqueued' It looks like I can not add a new request when others are running. Welcome any comment Thanks interdev

    Read the article

  • EXC_BAD_ACCESS on startAsynchronous request using ASIFormDataRequest

    - by user280556
    I am getting EXC_BAD_ACCESS on the Line: [asiUsernameRequest startAsynchronous]; in this code. Spent hours trying to figure it out, but no solution. Any idea? NSString *usernameValue = (NSString*)usernameField.text; NSLog(@"username selected: %@", usernameValue); NSURL *url = [NSURL URLWithString:@"http://www.mywebsite.com/api/usernameCheck"]; //ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; asiUsernameRequest = [[[ASIFormDataRequest alloc] initWithURL:url] retain]; [asiUsernameRequest setPostValue:usernameValue forKey:@"username"]; NSArray *objects = [NSArray arrayWithObjects:@"usernameCheck", nil]; NSArray *keys = [NSArray arrayWithObjects:@"action", nil]; asiUsernameRequest.userInfo = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; [asiUsernameRequest setDelegate:self]; [asiUsernameRequest startAsynchronous];

    Read the article

< Previous Page | 1 2 3  | Next Page >