当前位置:首页 > PHP教程 > PHP常见问题

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小工具测试

以上这篇php接口并发测试的方法(推荐)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持硕编程。



【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!