Level 51
try add empty array $cookies
$this->call('POST', '/api/v1/ask', ['user' => "me" , "id" => 1], [], ['image' => $file], ['HTTP_Authorization' => 'Bearer' . $token] ) ;
2 likes
Hello everyone, I am currently trying to test one of my site routes where a user uploads a photo. I keep on getting this same error and I am not sure what is wrong with my POST request. Any help would be greatly appreciated. Here is the code I have
$path = './public/uploads/B.png';
$original_name = 'B.png';
$mime_type = 'image/png';
$size = 600;
$error = null;
$test = true;
$file = new UploadedFile($path, $original_name, $mime_type, $size, $error, $test);
$this->call('POST', '/api/v1/ask', ['user' => "me" , "id" => 1], ['image' => $file], ['HTTP_Authorization' => 'Bearer' . $token] ) ;
try add empty array $cookies
$this->call('POST', '/api/v1/ask', ['user' => "me" , "id" => 1], [], ['image' => $file], ['HTTP_Authorization' => 'Bearer' . $token] ) ;
Please or to participate in this conversation.