You can use the non- _raw version on input you know for sure is plain text

parse_request(req, headers_lowercase = TRUE)

parse_request_raw(req, headers_lowercase = TRUE)

Arguments

req

HTTP request character string

headers_lowercase

if TRUE (the default) names in the headers data frame element are converted to lower case

Examples

paste0(c(
  "GET /uri.cgi HTTP/1.1\r\n",
  "User-Agent: Mozilla/5.0\r\n",
  "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n",
  "Host: 127.0.0.1\r\n", "\r\n"
), collapse = "") -> req

res <- parse_request(req)
res <- parse_request_raw(charToRaw(req))