prestashop Web服务API不断要求进行身份验证 [英] Prestashop Web Service API keeps asking for authentication
问题描述
我有这个问题,我从启用prestashop web服务,如果我写的网址直接传递参数从POST方法我可以访问它
http://underwearstudio.mx/pruebas/api?&ws_key= 的myKey
I am having this problem I enabled the webservice from prestashop and I can access it if I write the URL directly passing the parameter from post method http://underwearstudio.mx/pruebas/api?&ws_key="mykey".
但如果我尝试访问,而没有经过ws_key为参数它一直要求我进行验证。
But If I try to access without passing the ws_key as parameter it keeps asking me to authenticate.
从我读验证时提示您需要使用的API密钥的用户名并保留空白密码,但它只是不断提示的验证。
From what I read when authentication is prompted you need to use the API key as username and leave the blank password, but it just keeps prompting the authentication.
我能做些什么?
我试图按照本教程。(<一个href=\"http://doc.$p$pstashop.com/display/PS15/Chapter+2+-+Discovery+-+Testing+access+to+the+web+service+with+the+browser\" rel=\"nofollow\">http://doc.$p$pstashop.com/display/PS15/Chapter+2+-+Discovery+-+Testing+access+to+the+web+service+with+the+browser)
I was trying to follow this tutorial.(http://doc.prestashop.com/display/PS15/Chapter+2+-+Discovery+-+Testing+access+to+the+web+service+with+the+browser)
任何帮助将大大AP preciated
Any help would be greatly appreciated
推荐答案
有关的Google像我这样的:
For googlers such as myself:
在当前版本中,1.6.1.1,一是需要添加此code [&放大器; ws_key = YourSecretKey
]在URL的末尾,用这种方法访问web服务,作为通的用户名(在文档中所述)不能正常工作
as in the current version, 1.6.1.1, one need to add this code [?&ws_key=YourSecretKey
] at the end of the url and access the webservice with this method, as the passing as username (stated in the docs) does not work
http://[YourPrestaShopUrl]/api?&ws_key=YourSecretKey
eg: http://192.168.1.148/api/products?limit=5&ws_key=EUQ1J6NT1KVJ1S9SYGRCLGQE8IJU66DA
要做到这一点使用 web服务库时,你可能会加入这一行:
to accomplish this using the webservice library , you may add this line :
$url .= '&ws_key=' . $this->key;
在管线116(当前版本),这是在
at line 116 (in current version), which is in the
protected function executeRequest($url, $curl_params = array())
和正确初始化卷曲前:
$session = curl_init($url);
我在申请
您可能会发现工作库中现在这个主旨
You may find the working Library in this gist for now
这篇关于prestashop Web服务API不断要求进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!