沧海一粟

----not just a programmer

导航

2013年11月3日 #

iOS使用NSURLConnection发送同步和异步HTTP Request

摘要: 1. 同步发送- (NSString *)sendRequestSync{ // 初始化请求, 这里是变长的, 方便扩展 NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; // 设置 [request setURL:[NSURL URLWithString:urlStr]]; [request setHTTPMethod:@"POST"]; [request setValue:host forHTTPHeaderField:@"Host"]; NSString *con. 阅读全文

posted @ 2013-11-03 19:24 沧海一粟-啊添 阅读(4055) 评论(0) 推荐(0) 编辑