laravel-sdk / bigcommerce
该包最新版本(1.1)没有可用的许可信息。
使用guzzle进行http请求
1.1
2020-01-07 11:28 UTC
Requires
- guzzlehttp/guzzle: ^6.5
This package is auto-updated.
Last update: 2024-09-07 22:04:54 UTC
README
这不是官方文档
安装
- 在您的laravel项目中安装包,请运行以下命令。
composer require laravel-sdk/bigcommerce
- 安装后,转到项目配置文件app.php,并在provider部分添加以下行
Bigcommerce\BigcommerceServiceProvider::class,
API规范
This application adheres to the api specifications set us. This helps mix and match with laravel backend without conflicts.
代码概览
依赖项
- guzzlehttp
A Guzzle is a PHP HTTP client that makes it easy to send HTTP requests with data, headers and trivial to integrate with web services. Guzzle is a simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc.
环境变量
- .env
Environment variables can be set in this file.you need to set three environment variable like given below example with dummy data.
- AUTH_TOKEN = "g34zmq36hfo0frsgil0uhgj7ylvvgzvt" AUTH_CLIENT = "pi6liqvcvbcveuu44bzr3hw00ie5ukxi9v2m" STORE_HASH = "kmvyc5bz"
路由
- [getallproducts] - 获取所有产品,您可以使用分页,例如(http://127.0.0.1:8000/getallproduct?page=1&limit=10)。
- [getproductsbyid] - 获取单个产品(http://127.0.0.1:8000/getproductbyid?product_id=1272)。