PHP接口并发测试的方法(推荐)
如下所示:
header('Content-type:text/html; Charset=utf-8'); $uri = "输入你的url"; $data = array( 'test'=>1 ); $ch = curl_init(); // print_r($ch); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $return = curl_exec($ch); curl_close($ch);
然后用ab小工具测试
相关推荐
RocketJ 2020-05-31
luanyu 2020-02-18
abdstime 2020-01-17
abdstime 2020-01-14
goodby 2020-01-05
疯狂紫萧 2019-12-31
jocleyn 2019-12-23
Henryztong 2019-12-21
我是程序员 2010-11-03
Christsam 2019-09-07
mohanzb 2015-10-08
Testingba工作室 2015-09-28
Testingba工作室 2015-01-16
wooodyhuang 2013-03-12
加油奋斗吧 2015-01-16
智能的世界 2019-07-14
chenhualeguan 2013-10-16