Sets/Gets the content type. If 'type' is null, the method will attempt to determine the
type from the params, then from the environment setting
public function testRequestTypeFromHeader() { $request = new Request(array('env' => array('CONTENT_TYPE' => 'json'))); $this->assertEqual('json', $request->type()); }
public function testRequestTypeFromHeader() { $request = new Request(array('env' => array('Content-type' => 'json'))); $expected = 'json'; $result = $request->type(); $this->assertEqual($expected, $result); }