public function addParser(array $types, callable $parser)
    {
        foreach ($types as $type) {
            $type = strtolower($type);
            $this->parsers[$type] = $parser;
        }

        return $this;
    }
public function addParser(array $types, callable $parser)
    {
        foreach ($types as $type) {
            $type = strtolower($type);
            $this->parsers[$type] = $parser;
        }

        return $this;
    }
public function addParser ( array $ types , callable $ parser ) { foreach ( $ types as $ type ) { $ type = strtolower ( $ type ) ; $ this -> parsers [ $ type ] = $ parser ; } return $ this ; }
Add a parser.

Map a set of content-type header values to be parsed by the $parser.

### Example

An naive CSV request body parser could be built like so:

```
$parser->addParser(['text/csv'], function ($body) {
return str_getcsv($body);
});
```

@param array $types An array of content-type header values to match. eg. application/json
@param callable $parser The parser function. Must return an array of data to be inserted
into the request.
@return $this
Add a parser .