php 介面併發測試的方法
阿新 • • 發佈:2018-10-31
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小工具測試
---------------------
作者:omiracle123
來源:CSDN
原文:https://blog.csdn.net/oMiracle123/article/details/53433468?utm_source=copy
版權宣告:本文為博主原創文章,轉載請附上博文連結!