<titledata-rh="true">HTTPResponse class | Puppeteer</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://pptr.dev/next/api/puppeteer.httpresponse"><metadata-rh="true"property="og:locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docsearch:counter"content="3"><metadata-rh="true"property="og:title"content="HTTPResponse class | Puppeteer"><metadata-rh="true"name="description"content="The HTTPResponse class represents responses which are received by the Page class."><metadata-rh="true"property="og:description"content="The HTTPResponse class represents responses which are received by the Page class."><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://pptr.dev/next/api/puppeteer.httpresponse"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/next/api/puppeteer.httpresponse"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/next/api/puppeteer.httpresponse"hreflang="x-default"><linkdata-rh="true"rel="preconnect"href="https://DVKY664LG7-dsn.algolia.net"crossorigin="anonymous"><linkrel="search"type="application/opensearchdescription+xml"title="Puppeteer"href="/opensearch.xml">
<p>The HTTPResponse class represents responses which are received by the <ahref="/next/api/puppeteer.page">Page</a> class.</p>
<h4class="anchor anchorWithStickyNavbar_LWe7"id="signature">Signature:<ahref="#signature"class="hash-link"aria-label="Direct link to Signature:"title="Direct link to Signature:"></a></h4>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="remarks">Remarks<ahref="#remarks"class="hash-link"aria-label="Direct link to Remarks"title="Direct link to Remarks"></a></h2>
<p>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the <code>HTTPResponse</code> class.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="methods">Methods<ahref="#methods"class="hash-link"aria-label="Direct link to Methods"title="Direct link to Methods"></a></h2>
<table><thead><tr><th>Method</th><th>Modifiers</th><th>Description</th></tr></thead><tbody><tr><td><ahref="/next/api/puppeteer.httpresponse.buffer">buffer()</a></td><td></td><td>Promise which resolves to a buffer with response body.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.frame">frame()</a></td><td></td><td>A <ahref="/next/api/puppeteer.frame">Frame</a> that initiated this response, or <code>null</code> if navigating to error pages.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.fromcache">fromCache()</a></td><td></td><td>True if the response was served from either the browser's disk cache or memory cache.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.fromserviceworker">fromServiceWorker()</a></td><td></td><td>True if the response was served by a service worker.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.headers">headers()</a></td><td></td><td>An object with HTTP headers associated with the response. All header names are lower-case.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.json">json()</a></td><td></td><td>Promise which resolves to a JSON representation of response body.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.ok">ok()</a></td><td></td><td>True if the response was successful (status in the range 200-299).</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.remoteaddress">remoteAddress()</a></td><td></td><td>The IP address and port number used to connect to the remote server.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.request">request()</a></td><td></td><td>A matching <ahref="/next/api/puppeteer.httprequest">HTTPRequest</a> object.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.securitydetails">securityDetails()</a></td><td></td><td><ahref="/next/api/puppeteer.securitydetails">SecurityDetails</a> if the response was received over the secure connection, or <code>null</code> otherwise.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.status">status()</a></td><td></td><td>The status code of the response (e.g., 200 for a success).</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.statustext">statusText()</a></td><td></td><td>The status text of the response (e.g. usually an "OK" for a success).</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.text">text()</a></td><td></td><td>Promise which resolves to a text representation of response body.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.timing">timing()</a></td><td></td><td>Timing information related to the response.</td></tr><tr><td><ahref="/next/api/puppeteer.httpresponse.url">url()</a></td><td></td><td>The URL of the response.</td></tr></tbody></table></div></article><navclass="pagination-nav docusaurus-mt-lg"aria-label="Docs pages"><aclass="pagination-nav__link pagination-nav__link--prev"href="/next/api/puppeteer.httprequest.url"><divclass="pagination-nav__sublabel">Previous</div><divclass="pagination-nav__label">HTTPRequest.url</div></a><aclass="pagination-nav__link pagination-nav__link--next"href="/next/api/puppeteer.httpresponse.buffer"><divclass="pagination-nav__sublabel">Next</div><divclass="pagination-nav__label">HTTPResponse.buffer</div></a></nav></div></div><divclass="col col--3"><divclass="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ulclass="table-of-contents table-of-contents__left-border"><li><ahref="#remarks"class="table-of-contents__link toc-highlight">Remarks</a></li><li><ahref="#methods"class="table-of-contents__link toc-highlight">Methods</a></li></ul></div></div></div></div></main></div></div></div><footerclass="footer footer--dark"><divclass="container container-fluid"><divclass="row footer__links"><divclass="col footer__col"><divclass="footer__title">Community</div><ulclass="footer__items clean-list"><liclass="footer__item"><ahref="https://stackoverflow.com/questions/tagged/puppeteer"target="_blank"rel="noopener noreferrer"class="footer__link-item">Stack Overflow<svgwidth="13.5"height="13.5"aria-hidden="true"viewBox=