web.php

<?php
$http = new swoole_http_server("0.0.0.0", 9501);

$http->on('request', function ($request, $response) {
    var_dump($request->get, $request->post);
    $response->header("Content-Type", "text/html; charset=utf-8");
    $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>");
});

$http->start();

 效果如下

swoole web服务

 

http访问:http://192.168.204.130:9501/?dds=333  即可访问,服务器端可以获取dds参数值

相关文章:

  • 2021-09-16
  • 2021-12-30
  • 2021-09-06
  • 2022-01-15
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-26
  • 2022-12-23
  • 2021-10-01
  • 2021-11-24
  • 2021-06-27
  • 2022-03-07
  • 2022-02-06
相关资源
相似解决方案