I'm building an application in the iPhone where the communication with a PHP server is needed (using XML).
I'm able to receive data from the server and I handle the xml file using the NSXML parser.
I haven't found too much documentation about sending data from the iPhone to the server (via XML).
Any idea, links, and examples will be appreciated.
Fade in/out UIScrollView's content like Mobile Safari does in its tab
1:warning: declaration does not declare anything
It takes a few more steps to send this POST asynchronously. You must read around this in the docs for NSURLConnection and the URL Loading System..
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:@"http://yourserver.com/script"]; [request setHTTPMethod:@"POST"]; const char *bytes = [[NSString stringWithFormat:@"<?xml version=\"1.0\">\n<yourxml>%@</yourxml>", yourData] UTF8String]; [request setBody:[NSData dataWithBytes:bytes length:strlen(bytes)]]; NSURLResponse *response; NSError *err; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];