parse_media

0th

Percentile

Parse a media type.

Parsed according to RFC 2616, as at http://pretty-rfc.herokuapp.com/RFC2616#media.types.

Keywords
internal
Usage
parse_media(x)
Details

A simplified minimal EBNF is:

  • media-type = type "/" subtype *( ";" parameter )
  • type = token
  • subtype = token
  • parameter = attribute "=" value
  • attribute = token
  • value = token | quoted-string
  • token = 1*@,;:\"/[]?={}
  • quoted-string = " *(any text except ", unless escaped with \) "

Aliases
  • parse_media
Examples
parse_media("text/plain")
parse_media("text/plain; charset=utf-8")
parse_media("text/plain; charset=\"utf-8\"")
parse_media("text/plain; randomparam=\";=;=\"")
Documentation reproduced from package httr, version 0.6.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.