lib-hub / restrequest
一个PHP curl包装器,用于简化使用PHP创建RESTful请求。
1.0.1
2021-06-29 10:58 UTC
Requires
- php: ^7.4
- ext-curl: *
This package is auto-updated.
Last update: 2024-09-29 05:56:42 UTC
README
一个PHP curl包装器,用于简化使用PHP创建RESTful请求。
安装
composer require lib-hub/restrequest
使用
基本示例
$productsRequest = new RestRequest($baseUrl . "/product"); $productsRequest->post("payload"); // create new product $productsRequest->put("1", "data"); // update first product $productsRequest->patch("1", "data"); // edit first product $productsRequest->delete("1"); // delete first product $productsRequest->get(); // get all products $productsRequest->get("1"); // get first product