NSString *urlString = [NSString stringWithFormat:@"http://192.168.1.58:8089/smart_age/test2.php"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSHTTPURLResponse* urlResponse = nil;
NSError *error = [[NSError alloc] init];
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
NSString *result = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];现在的url :"http://192.168.1.58:8089/smart_age/test2.php"可以访问到php的test.php页面,但是我现在想调用 test.php页面中的hello方法,该如何调用??
我尝试过将这个hello拼到url 后面可是不行。
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSHTTPURLResponse* urlResponse = nil;
NSError *error = [[NSError alloc] init];
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
NSString *result = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];现在的url :"http://192.168.1.58:8089/smart_age/test2.php"可以访问到php的test.php页面,但是我现在想调用 test.php页面中的hello方法,该如何调用??
我尝试过将这个hello拼到url 后面可是不行。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货