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

parse_response(resp, headers_lowercase = TRUE)

parse_response_raw(resp, headers_lowercase = TRUE)

Arguments

resp

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(
  "HTTP/1.1 200 OK\r\n",
  "Server: nginx/1.2.1\r\n",
  "Content-Type: text/html\r\n",
  "Content-Length: 8\r\n",
  "Connection: keep-alive\r\n",
  "\r\n",
  "<html />"
), collapse = "") -> resp

res <- parse_response(resp)
res <- parse_response_raw(charToRaw(resp))