EVOLUTION-MANAGER
Edit File: parse_headers.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Parse response headers</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for parse_headers {curl}"><tr><td>parse_headers {curl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Parse response headers</h2> <h3>Description</h3> <p>Parse response header data as returned by curl_fetch, either as a set of strings or into a named list. </p> <h3>Usage</h3> <pre> parse_headers(txt, multiple = FALSE) parse_headers_list(txt) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>txt</code></td> <td> <p>raw or character vector with the header data</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>parse multiple sets of headers separated by a blank line. See details.</p> </td></tr> </table> <h3>Details</h3> <p>The parse_headers_list function parses the headers into a normalized (lowercase field names, trimmed whitespace) named list. </p> <p>If a request has followed redirects, the data can contain multiple sets of headers. When multiple = TRUE, the function returns a list with the response headers for each request. By default it only returns the headers of the final request. </p> <h3>Examples</h3> <pre> req <- curl_fetch_memory("https://httpbin.org/redirect/3") parse_headers(req$headers) parse_headers(req$headers, multiple = TRUE) # Parse into named list parse_headers_list(req$headers) </pre> <hr /><div style="text-align: center;">[Package <em>curl</em> version 4.3 <a href="00Index.html">Index</a>]</div> </body></html>