PHP code example of neogreco / json-request-parser

1. Go to this page and download the library: Download neogreco/json-request-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

neogreco / json-request-parser example snippets




use JSON\tools\JSONRequestParser;

class SomeController extends Controller
{

public function index(Request $request)
    {
        try {
            $json = JSONRequestParser::extractJsonFrom($request->getContent(), $request->header('Content-Encoding'));