创建rest api url以连接mysql数据库

2021-11-15 00:00:00 api rest mysql

我想学习如何创建一个 rest api url,以便我可以使用该 url 获取信息并将其发布到我的 mysql 数据库中.

I want to learn how to create a rest api url so that I could get and post information into my mysql database using that url.

在谷歌上搜索了很多并阅读了各种文章,但没有找到任何可以学习的内容.一切都以 about apis 开始,以已经创建的 rest url 结束.

Googled alot and read various article and didnt find anything precise to learn on this. All are start with about apis and ends with already created rest urls.

有人可以帮忙吗?

如何创建我自己的 url 和授权密钥等?

How to create my own url and authorization key etc ?

提前致谢!!

推荐答案

这应该可以帮助您: https://github.com/mevdschee/php-crud-api

CRUD 代表:C阅读读读U日期D删除

CRUD stands for: Create Read Update Delete

这个 api 是用 PHP 编写的,给你一个简单而舒适的机会访问您的数据库(MySQL、SQLite 3、PostgreSQL 9 或 MS SQL Server 2012).它有据可查,而且很容易上手.

This api is written in PHP and gives you a simple and comfortable opportunity to access your database (MySQL, SQLite 3, PostgreSQL 9 orMS SQL Server 2012). Its well documented and its gonna be easy to get started.

如果您需要更多自定义的东西,而不仅仅是原始数据,您应该借助框架编写自己的 api,例如 SlimFramework,您可以在其中指定请求的方法.

If you need something more custom and not only raw data you should write your own api with help of an framework for example the SlimFramework, where you can specify the methods for requests.

因为rest apis有比GET和POST更多的方法.

Cause for rest apis there are more methods than GET and POST.

祝你好运;)

相关文章