How to resolve syntax error, unexpected [ in guzzle?

匆匆过客 提交于 2019-12-01 09:45:18

问题


I am trying to using guzzle to pass the referer as mentioned by one of the stackoverflow user on one of my question asked here: related stackoverflow question unresolved

require_once("../plugins/Guzzle/vendor/autoload.php");

    //use GuzzleHttp\Client;
    $headers = ['Referer' => 'https://mywebsite.com'];  
    $httpClient = new Client([
'headers' => $headers
]);

but above through the error: syntax error, unexpected '[' and nothing works.:(

So can anyone please help me to find my mistake or what I am doing wrong here.

This question is a bit different as after improving guzzle to resolve the previous "referer" error. I end up with this new guzzle error.

So both questions have it's own issue.

Thanks

来源:https://stackoverflow.com/questions/58177292/how-to-resolve-syntax-error-unexpected-in-guzzle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!