Category: Postman
-
Post Views: 29 1. Implement the corresponding RESTful-style web service API of the page in the API directory, and then adjust it to the RPC client 2. After all the corresponding APIs of the page are implemented, the POST request is executed in Postman, and the response is normal, as shown in Figure 1 3. Execute the PUT /pages/1 request…
-
Post Views: 29 1. The API can distinguish application/x-www-form-urlencoded and multipart/form-data input formats by default, and view \api\config\main.php, request Configuration of application components 2. POST request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/x-www-form-urlencoded, as shown in Figure 1 3. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, input format: multipart/form-data, as shown in Figure 2 4. Post request in Postman,http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/users, the input format: application/json, data…
-
Post Views: 32 1. Based on yii2tech\ar\SoftDelete\SoftDeleteBehavior, the soft deletion of ActiveRecord is realized, and the URL is opened:https://github.com/yiisoft/yii2/blob/master/docs/guide-zh-CN/concept-behaviors.md, as shown in Figure 1 2. Install the ActiveRecord extension of Yii2, use the self-update command to update the composer to the latest version, use the update command to obtain the latest version of the dependencies, and upgrade the composer.lock file,…
-
Post Views: 53 1. In the development environment, the execution of the database migration command fails: 1071 Specified key was too long; Max key length is 767 bytes, as shown in Figure 17 2. Run sql in the database in the development environment, and report an error: #1071 – specific key was too long; max key length is 767 bytes,…
-
Post Views: 17 1. Configure the client through the application component, \common\config\main-local.php 2. Set the format used for the request content to json through the setFormat() method, \common\logics\http\yqdsj_api\article.php 3. When using the REST API, since the request format is all JSON, in order to simplify the code, the format of the request object can be directly configured. by configuring[[\yii\httpclient\Client]] requestConfig…