我正在用laravel写测试。我要邮寄JSON。下面是图片

如何在json中发送postJson数据?
/**
* A basic feature test example.
*
* @return void
*/
public function test_create_attribute()
{
$response = $this->postJson('/api/catalog/attributes?storeId=1000000006', How to send json data);
$response->assertStatus(201);
}发布于 2022-09-15 11:15:05
use Illuminate\Support\Facades\Http;
$response = Http::post('http://example.com/users', [
'name' => 'Steve',
'role' => 'Network Administrator',
]);https://stackoverflow.com/questions/73730083
复制相似问题