curl请求的url中含有空格时(例如rul的参数是sql查询语句,url=www.tets.com/query.php?sql=select * from t1),curl_easy_perform()将不会得到正确的结果. 需要处理一下空格,用%20替换掉每一个空格,即将select * from t1换成select%20*%20from%20t1
一,代码. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //直接传是没反应的,去掉其中的空格 NSString *url=[[NSString stringWithFormat:@"http://baidu.com"] stringByAddingPercentEscapesUsingEncoding
var strsql=" select e.* from es_doc_main e where 1=1" +" and e.doccode='"+prtNo+"' and e.subtype <> '1022' and e.busstype='TB' order by subtype "; //strsql.replace(/\s+/g,"%20"); if(arrResult[0][0]=='01') { ea