2 KiB
			
		
	
	
	
	
	
	
	
			
		
		
	
	
			2 KiB
			
		
	
	
	
	
	
	
	
ProtocolResponse Object
- errorInteger (optional) - When assigned, the- requestwill fail with the- errornumber . 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". Setting- mimeTypewould implicitly set the- content-typeheader in response, but if- content-typeis already set in- headers, the- mimeTypewould 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 returning- Bufferas response, this is a- Buffer. When returning- Stringas response, this is a- String. 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 the- urland pipe the result as response body. This is only used for URL responses.
- referrerString (optional) - The- referrerURL. This is only used for file and URL responses.
- methodString (optional) - The HTTP- method. This is only used for file and URL responses.
- sessionSession (optional) - The session used for requesting URL, by default the HTTP request will reuse the current session. Setting- sessionto- nullwould use a random independent session. This is only used for URL responses.
- uploadDataProtocolResponseUploadData (optional) - The data used as upload data. This is only used for URL responses when- methodis- "POST".
