ASIHTTPRequest wrapper usage for Macs

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-04-25T01:28:10Z Indexed on 2010/04/25 1:33 UTC
Read the original article Hit count: 331

I am trying to apply the ASIHTTPRequest wrapper to a very basic Objective C program. I have already copied over the necessary files into my program and after giving myself an extreme headache trying to figure out how it works through their website I thought I would post a question on here. The files copied over were:

ASIHTTPRequestConfig.h
ASIHTTPRequestDelegate.h
ASIProgressDelegate.h
ASIInputStream.h
ASIInputStream.m
ASIHTTPRequest.h
ASIHTTPRequest.m
ASIFormDataRequest.h
ASIFormDataRequest.m

My program is very basic:

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

 // Defining the various variables.
 char firstName[20];  
 char lastName[20];
 char rank[5];
 int leaveAccrued;
 int leaveRequested;

 // User Input.
 NSLog (@"Please input First Name:");
 scanf("%s", &firstName); 

 NSLog (@"Please input Last Name:");
 scanf("%s", &lastName); 

 NSLog (@"Please input Rank:");
 scanf("%s", &rank); 

 NSLog (@"Please input the number leave days you have accrued:");
 scanf("%i", &leaveAccrued); 

 NSLog (@"Please input the number of leave days you are requesting:");
 scanf("%i", &leaveRequested); 

 // Print results.
 NSLog (@"Name: %s %s", firstName, lastName);
 NSLog (@"Rank: %s", rank);
 NSLog (@"Leave Accrued: %i", leaveAccrued);
 NSLog (@"Leave Requested: %i", leaveRequested);


    [pool drain];
    return 0;
}

How do I utilize the wrapper to export these 5 basic variables to a web server via an http request?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about asihttprequest