2017-12-02 69 views

回答

0

乔, 我做一个小测试,这是你需要做的的API调用:

$params = array("email" => "[email protected]"); 
$getContact = $wcApi->get('customers',$params); 

echo "<pre>"; 
print("<pre>".print_r($getContact , true)."</pre>"); 
echo"</pre>"; 

如果将测试url打电话如下:

https://localhost/biobays/wp-json/wc/v2/customers?email=test%40t.com&consumer_key=YOUR_CONSUMER_KEY&consumer_secret=YOUR_CONSUMER_SECRET 

如果没有电子邮件存在,则返回一个空数组。

+0

你好瑞克,我会测试你的解决方案。如果我理解的很好,我的问题与编码%40而不是@有关。我会检查并给你反馈。 非常感谢! –

+0

Hi Rick,https:// localhost/biobays/wp-json/wc/v2/customers?email = test%40t.com&consumer_key = YOUR_CONSUMER_KEY&consumer_secret = YOUR_CONSUMER_SECRET与curl一起工作得很好,但Alamofire没有任何返回。很奇怪 ... –