我目前正在尝试使用GuzzleHttp
与Laravel一起访问基于用户输入的API。GuzzleHttp和Laravel - 语法错误 - T_String
我的建立至今:
$client = new \GuzzleHttp\Client();
$response = $client
->get('https://api.postcodes.io/postcodes/'Input::get('postcode'));
dd($response->getBody());
,但返回的错误是:
FatalErrorException在ClinicController.php行129:语法错误,意外 '输入'(T_STRING)
线129 https://api.postcodes.io/postcodes/'Input::get('postcode')
任何帮助为什么会发生这将非常感激。
谢谢Alan,我认为'Input ::'确实会清理所有输入?在使用之前,邮编通过“正则表达式”检查器。 – Ben