puppeteer/assets/js/6ab3bf56.535f0243.js
release-please[bot] cc95c085a2 deploy: 1014abc087
2023-11-29 13:34:30 +00:00

2 lines
7.4 KiB
JavaScript

/*! 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.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"True if the response was successful (status in the range 200-299)."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.remoteaddress",children:"remoteAddress()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"The IP address and port number used to connect to the remote server."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.request",children:"request()"})}),(0,r.jsx)(s.td,{}),(0,r.jsxs)(s.td,{children:["A matching ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httprequest",children:"HTTPRequest"})," object."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.securitydetails",children:"securityDetails()"})}),(0,r.jsx)(s.td,{}),(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.a,{href:"/next/api/puppeteer.securitydetails",children:"SecurityDetails"})," if the response was received over the secure connection, or ",(0,r.jsx)("code",{children:"null"})," otherwise."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.status",children:"status()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"The status code of the response (e.g., 200 for a success)."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.statustext",children:"statusText()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:'The status text of the response (e.g. usually an "OK" for a success).'})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.text",children:"text()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"Promise which resolves to a text 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.timing",children:"timing()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"Timing information related to the response."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.url",children:"url()"})}),(0,r.jsx)(s.td,{}),(0,r.jsx)(s.td,{children:"The URL of the response."})]})]})]})]})}function c(e={}){const{wrapper:s}={...(0,n.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},75251:(e,s,t)=>{var r=t(67294),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function a(e,s,t){var r,i={},a=null,o=null;for(r in void 0!==t&&(a=""+t),void 0!==s.key&&(a=""+s.key),void 0!==s.ref&&(o=s.ref),s)p.call(s,r)&&!h.hasOwnProperty(r)&&(i[r]=s[r]);if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:n,type:e,key:a,ref:o,props:i,_owner:d.current}}s.Fragment=i,s.jsx=a,s.jsxs=a},85893:(e,s,t)=>{e.exports=t(75251)},11151:(e,s,t)=>{t.d(s,{Z:()=>d,a:()=>p});var r=t(67294);const n={},i=r.createContext(n);function p(e){const s=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:p(e.components),r.createElement(i.Provider,{value:s},e.children)}}}]);