問題描述
我想學習如何創建一個 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.
祝你好運;)
這篇關于創建rest api url以連接mysql數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!