Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parse_media

Parse a media type.


Description

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

Usage

parse_media(x)

Arguments

x

String to parse

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*<any CHAR except CTLs or ()<>@,;:\"/[]?=\{\}

Examples

parse_media("text/plain")
parse_media("text/plain; charset=utf-8")
parse_media("text/plain; charset=\"utf-8\"")
parse_media("text/plain; randomparam=\";=;=\"")

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.