public static function create_from_request($request) {
        if($type = $request->getVar('accept')) {
            try {
                if(array_key_exists($type, self::$lookup)) {
                    return self::create(self::$lookup[$type]);
                }
            } catch(\Exception $e) {}
        }
        $types = $request->getAcceptMimetypes();
        foreach($types as $type) {
            try {
                return self::create($type);
            } catch(RestUserException $e) {}
        }
        return self::create();
    }