注:接收到的数据模式和GET的一样,都是news,在此不写了
Post的同步请求方法-需要设置请求方式为:post,也要设置url和body
//POST请求时的url
#define POST_URL @"http://ipad-bjwb.bjd.com.cn/DigitalPublication/publish/Handler/APINewsList.ashx"
#define POST_BODY @"date=20150921&startRecord=1&len=5&udid=1234567890&terminalType=Iphone&cid=213"
#pragma mark==============POST 同步请求==================
- (IBAction)postSynchronizationAction:(id)sender
{
//1.创建url
NSURL *url = [NSURL URLWithString:POST_URL];
//2.创建请求对象
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
//设置请求方法
request.HTTPMethod = @"POST";