[NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:nil]
[NSJSONSerialization dataWithJSONObject:jsonString options:0 error:nil]
,注意并不是所有的OC对象都能够序列化为JSON数据使用步骤:
使用步骤:
DOM 一次性加载 GDataXML
SAX 一个元素一个元素的解析 NSXMLParser(创建解析器->设置代理->开始解析)
NSString *header = [NSString stringWithFormat:@"bytes=%zd-",self.currentSize];
[request setValue:header forHTTPHeaderField:@"Range"]
0.1--1.0 "2.0---2.6.3" 3.0-->3.1.0
NSURLConnection - (NSURLConnection + NSURLSession) - NSURLSessio
0.1-2.0 NSURLConnection
2.0 -3.0 NSURLSession + NSURLConnection
3.0 + NSURLSession
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
didSendBodyData:(int64_t)bytesSent
totalBytesSent:(int64_t)totalBytesSent
totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
①:[http://192.168.31.520:1314/loveyou?place=Beijing&Shanghai](http://120.25.226.186:32812/weather?place=Beijing&Shanghai)
②:[http://](http://120.25.226.186:32812/weather?place=Beijing&place=Shanghai)[192.168.31.520:1314](http://120.25.226.186:32812/weather?place=Beijing&Shanghai)/loveyou?place=Beijing&place=Shanghai
第二种请求路径是正确的,第一种是错误的,后面的shanghai将会被忽略
此处为隐藏的内容!
发表评论并刷新,才能查看