ProtocolResponse Object
errorInteger (optional) - When assigned, therequestwill fail with theerrornumber . For the available error numbers you can use, please see the net error list.statusCodenumber (optional) - The HTTP response code, default is 200.charsetstring (optional) - The charset of response body, default is"utf-8".mimeTypestring (optional) - The MIME type of response body, default is"text/html". SettingmimeTypewould implicitly set thecontent-typeheader in response, but ifcontent-typeis already set inheaders, themimeTypewould be ignored.headersRecord<string, string | string[]> (optional) - An object containing the response headers. The keys must be string, and values must be either string or Array of string.data(Buffer | string | ReadableStream) (optional) - The response body. When returning stream as response, this is a Node.js readable stream representing the response body. When returningBufferas response, this is aBuffer. When returningstringas response, this is astring. This is ignored for other types of responses.pathstring (optional) - Path to the file which would be sent as response body. This is only used for file responses.urlstring (optional) - Download theurland pipe the result as response body. This is only used for URL responses.referrerstring (optional) - ThereferrerURL. This is only used for file and URL responses.methodstring (optional) - The HTTPmethod. This is only used for file and URL responses.sessionSession (optional) - The session used for requesting URL. The HTTP request will reuse the current session by default.uploadDataProtocolResponseUploadData (optional) - The data used as upload data. This is only used for URL responses whenmethodis"POST".