puppeteer/assets/js/6ab3bf56.535f0243.js

2 lines
7.4 KiB
JavaScript
Raw Normal View History

/*! For license information please see 6ab3bf56.535f0243.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[38236],{74139:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>h,contentTitle:()=>p,default:()=>c,frontMatter:()=>i,metadata:()=>d,toc:()=>a});var r=t(85893),n=t(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/../docs/api/puppeteer.httpresponse.md",sourceDirName:"api",slug:"/api/puppeteer.httpresponse",permalink:"/next/api/puppeteer.httpresponse",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"HTTPResponse"},sidebar:"api",previous:{title:"HTTPRequest.url",permalink:"/next/api/puppeteer.httprequest.url"},next:{title:"HTTPResponse.buffer",permalink:"/next/api/puppeteer.httpresponse.buffer"}},h={},a=[{value:"Signature:",id:"signature",level:4},{value:"Remarks",id:"remarks",level:2},{value:"Methods",id:"methods",level:2}];function o(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,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"httpresponse-class",children:"HTTPResponse class"}),"\n",(0,r.jsxs)(s.p,{children:["The HTTPResponse class represents responses which are received by the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page",children:"Page"})," class."]}),"\n",(0,r.jsx)(s.h4,{id:"signature",children:"Signature:"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-typescript",children:"export declare abstract class HTTPResponse\n"})}),"\n",(0,r.jsx)(s.h2,{id:"remarks",children:"Remarks"}),"\n",(0,r.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,r.jsx)(s.code,{children:"HTTPResponse"})," class."]}),"\n",(0,r.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Method"}),(0,r.jsx)(s.th,{children:"Modifiers"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.buffer",children:"buffer()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"Promise which resolves to a buffer with response body."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.frame",children:"frame()"})}),(0,r.jsx)(s.td,{}),(0,r.jsxs)(s.td,{children:["A ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame",children:"Frame"})," that initiated this response, or ",(0,r.jsx)("code",{children:"null"})," if navigating to error pages."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.fromcache",children:"fromCache()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"True if the response was served from either the browser's disk cache or memory cache."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.fromserviceworker",children:"fromServiceWorker()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"True if the response was served by a service worker."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.headers",children:"headers()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"An object with HTTP headers associated with the response. All header names are lower-case."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.json",children:"json()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"Promise which resolves to a JSON representation of response body."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.ok",children:"ok()"})}),(0,r.