mysql 和 php 以及用于 Web 服务的 Restler
有谁知道如何编写 Restler 代码以与 php 和 mysql 一起使用以生成类似以下内容的内容:
我想创建一个 XML API Web 服务,但不知道从哪里开始。
我希望人们能够使用 http 请求在数据库中查询如下信息。
数据示例
BrandName
价格
ShortDescription
SKU
查询示例
http:// website.com/productxml?dep=1&Count=3&BrandName=Y&Price=Y
我将如何编写这样一个脚本,因为我在互联网上搜索过并且找不到任何例子,想知道你是否可以提供帮助。
预先感谢
罗伊
Does anyone know how to code restler to work with php and mysql to produce something like the following:
I want to create a XML API Web Service and not sure where to start.
I want people to be able to query the database for information such as the following using a http request.
Example of Data
BrandName
Price
ShortDescription
SKU
Example Query
http://website.com/productxml?dep=1&Count=3&BrandName=Y&Price=Y
How would I go about writing such a script as I have searched the internet and cant find any examples and was wondering if you can help.
Thanks in advance
Roy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 Restler (http://luracast.com/products/restler/) 并构建一个方法
它处理您的请求。
请参阅示例 (http://help.luracast.com/restler/examples/)这是可以做到的。
希望这有帮助。
问候。
You could use Restler (http://luracast.com/products/restler/) and build a method
which handles your request.
See the examples (http://help.luracast.com/restler/examples/) how this can be done.
Hope this helps.
Greets.
您可以使用 Restler @Restler Luracast。
发展势头明显增强,且稳定。
这个框架的有趣之处在于它支持多种格式。只需插入一行代码即可添加所有这些格式:
另外,我想参考我在 bitbucket 上的 Luracast Restler 模板,它是公开的,供每个人查看。
我将 Restler 与 Doctrine 结合起来,因此从数据库捕获数据从未如此简单。目前它是原始版本,但我会尽快更新。
我的版本使用vagrant。它是虚拟化技术的扩展,使开发设置变得简单快捷。一旦您的应用程序准备就绪,您就可以将其部署到您的服务器。
链接:Restler+Doctrine
1) 安装 virtualbox + vagrant
2) 克隆我的存储库
3 ) 移动到克隆的目录。
4) vagrant up
5) 在 10 分钟内享受并开始编写您的 REST API。
You could use Restler @Restler Luracast.
The development has increased alot and its stable.
The fun part about this framework is that it supports multiple formats. All these formats can be added by just inserting a single line of code:
Also I would like to refer to my Luracast Restler template on bitbucket its public and its there for everybody to see.
I combined Restler with Doctrine so catching data from databases has never been easier. Its a raw version for now but I'll update it soon.
My version uses vagrant. Its a extension to virtualisation technology that makes development setup easy and fast. Once your application is ready you can deploy it to your server.
Link:Restler+Doctrine
1) Install virtualbox + vagrant
2) Clone my repository
3) Move to the cloned directory.
4) vagrant up
5) Enjoy and start programming your REST API in less than 10 minutes.