News新闻

业界新闻动态、技术前沿
Who are we?

您的位置:首页      乐道系统FAQ      PHP接口并发测试的方法(推荐)

PHP接口并发测试的方法(推荐)

发布日期:2016-12-15 00:00:00 81

如下所示:

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);