/**
* force all requests to be json like.
*
* Do JSON/RESTful requests using this client if the caller has not specified something else.
*
* @param object $request Request object
*
* @return \Symfony\Component\HttpFoundation\Response request
*/
protected function doRequest($request)
{
if ($this->jsonRequest) {
$request->headers->set('Content-Type', 'application/json; charset=UTF-8');
}
$request->headers->set('Accept', 'application/json');
return parent::doRequest($request);
}