code for sending & recievieng the data to the server through Get and Post method in xcode
.h file @interface ConnectionExampleViewController : UIViewController @property ( retain , nonatomic ) NSURLConnection *connection; @property ( retain , nonatomic ) IBOutlet UIButton *btn_post; @property ( retain , nonatomic ) IBOutlet UIButton *btn_get; @property ( retain , nonatomic ) NSMutableData *receivedData; -( IBAction )btn_get_clicked:( id )sender; -( IBAction )btn_post_clicked:( id )sender; .m file -( IBAction )btn_get_clicked:( id )sender { NSMutableURLRequest *request = [[ NSMutableURLRequest alloc ] init ] ; NSString *urlString = @"http://www.example.com/command=18&email=email&exchanges=hong%20kong%20Stock%20Exchange&instrumentclass=Stock&payforservice=YES&country=china" ; [request setURL :[ NSURL URLWithString :urlString]]; [request setHTTPMethod : @"GET" ]; NSString *type = [ NSString stringWithFormat : @"application/x-www-fo...
Comments
Post a Comment