puppeteer/assets/js/a43d4ebe.0805ef97.js

2 lines
7.4 KiB
JavaScript
Raw Normal View History

/*! For license information please see a43d4ebe.0805ef97.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[43402],{242:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>h,contentTitle:()=>p,default:()=>c,frontMatter:()=>i,metadata:()=>d,toc:()=>o});var t=r(85893),n=r(11151);const i={sidebar_label:"HTTPResponse"},p="HTTPResponse class",d={id:"api/puppeteer.httpresponse",title:"HTTPResponse class",description:"The HTTPResponse class represents responses which are received by the Page class.",source:"@site/versioned_docs/version-21.6.0/api/puppeteer.httpresponse.md",sourceDirName:"api",slug:"/api/puppeteer.httpresponse",permalink:"/api/puppeteer.httpresponse",draft:!1,unlisted:!1,tags:[],version:"21.6.0",frontMatter:{sidebar_label:"HTTPResponse"},sidebar:"api",previous:{title:"HTTPRequest.url",permalink:"/api/puppeteer.httprequest.url"},next:{title:"HTTPResponse.buffer",permalink:"/api/puppeteer.httpresponse.buffer"}},h={},o=[{value:"Signature:",id:"signature",level:4},{value:"Remarks",id:"remarks",level:2},{value:"Methods",id:"methods",level:2}];function a(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,n.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"httpresponse-class",children:"HTTPResponse class"}),"\n",(0,t.jsxs)(s.p,{children:["The HTTPResponse class represents responses which are received by the ",(0,t.jsx)(s.a,{href:"/api/puppeteer.page",children:"Page"})," class."]}),"\n",(0,t.jsx)(s.h4,{id:"signature",children:"Signature:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-typescript",children:"export declare abstract class HTTPResponse\n"})}),"\n",(0,t.jsx)(s.h2,{id:"remarks",children:"Remarks"}),"\n",(0,t.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,t.jsx)(s.code,{children:"HTTPResponse"})," class."]}),"\n",(0,t.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{children:"Method"}),(0,t.jsx)(s.th,{children:"Modifiers"}),(0,t.jsx)(s.th,{children:"Description"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.buffer",children:"buffer()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"Promise which resolves to a buffer with response body."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.frame",children:"frame()"})}),(0,t.jsx)(s.td,{}),(0,t.jsxs)(s.td,{children:["A ",(0,t.jsx)(s.a,{href:"/api/puppeteer.frame",children:"Frame"})," that initiated this response, or ",(0,t.jsx)("code",{children:"null"})," if navigating to error pages."]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.fromcache",children:"fromCache()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"True if the response was served from either the browser's disk cache or memory cache."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.fromserviceworker",children:"fromServiceWorker()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"True if the response was served by a service worker."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.headers",children:"headers()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"An object with HTTP headers associated with the response. All header names are lower-case."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.json",children:"json()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"Promise which resolves to a JSON representation of response body."})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{children:(0,t.jsx)(s.a,{href:"/api/puppeteer.httpresponse.ok",children:"ok()"})}),(0,t.jsx)(s.td,{}),(0,t.jsx)(s.td,{children:"T