阅读(3141)
赞(7)
Laravel 8 发送 URL 编码的请求
2021-07-05 10:24:26 更新
如果你希望使用 application/x-www-form-urlencoded
作为请求的数据类型,你可以在创建请求前调用 asForm
方法:
$response = Http::asForm()->post('http://test.com/users', [
'name' => 'Sara',
'role' => 'Privacy Consultant',
]);