def main_type
    return nil unless @header['content-type']
    self['Content-Type'].split(';').first.to_s.split('/')[0].to_s.strip
  end
Returns a content type string such as "text".
This method returns nil if Content-Type: header field does not exist.