diff --git a/book/testing.rst b/book/testing.rst index 290a211205a..df575554168 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -343,6 +343,16 @@ or perform more complex requests:: // Directly submit a form (but using the Crawler is easier!) $client->request('POST', '/submit', array('name' => 'Fabien')); + // Submit a raw JSON string + $client->request( + 'POST', + '/submit', + array(), + array(), + array('CONTENT_TYPE' => 'application/json'), + '{"name":"Fabien"}' + ); + // Form submission with a file upload use Symfony\Component\HttpFoundation\File\UploadedFile;