ITeye博客

IOS HTTP 同步请求

jguangyou · 2012-12-04 17:20 · iOS · 移动开发 · Markdown

NSURL* url = [NSURL URLWithString:urlString];

    NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:10];

NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];

        NSString *aString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。