parse_response.Rd
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)
resp | HTTP request character string |
---|---|
headers_lowercase | if |
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))