Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

test post request laravel

<?php
 
namespace TestsFeature;
 
use TestsTestCase;
 
class ExampleTest extends TestCase
{
    /**
     * A basic functional test example.
     *
     * @return void
     */
    public function test_interacting_with_headers()
    {
        $response = $this->withHeaders([
            'X-Header' => 'Value',
        ])->post('/user', ['name' => 'Sally']);
 
        $response->assertStatus(201);
    }
}
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #test #post #request #laravel
ADD COMMENT
Topic
Name
7+7 =