Home  >  Article  >  Backend Development  >  Methods for concurrency testing of PHP interfaces

Methods for concurrency testing of PHP interfaces

墨辰丷
墨辰丷Original
2018-05-29 15:13:052902browse

This article mainly introduces the method of concurrency testing of PHP interface. Interested friends can refer to it. I hope it will be helpful to everyone.

is as follows:


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


Then use ab Gadget Test

The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

php SMS interface code, php SMS interface

Detailed explanation of PHP interface and reference interface

php SMS interface code, php SMS interface_PHP tutorial

The above is the detailed content of Methods for concurrency testing of PHP interfaces. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn