magento rest api 调用

来源:互联网 发布:代购淘宝店怎么开店 编辑:程序博客网 时间:2024/06/05 08:51

1.

需要在magento后台设置:

参看文章:http://inchoo.net/ecommerce/magento/configure-magento-rest-and-oauth-settings/

2

设置好后,需要在服务器做重写规则

apache:在htaccess文件中加入:

RewriteRule ^api/rest api.php?type=rest [QSA,L]
nginx:在none.conf中加入:

location /api {
        rewrite /api/rest /api.php?type=rest ;
    }

也就是说,将/api/rest 重写到 /api.php?type=rest

这个设置非常关键,不然会出现404 not found错误,这个问题也是谷歌了好久才找到这个原因。

3

数据取出:

参考文章:

http://blog.ifeeline.com/542.html


例子下载地址:http://blog.ifeeline.com/wp-content/uploads/2013/04/OAuth_Client.zip

下载地址转自:ifeeline.com

4

配置这个插件的indexcontroller.php

里面的参数配置好后,运行即可。







0 0
原创粉丝点击