errorInteger (optional) - When assigned, the request will fail with the error number . 分配后,request将失败,并显示error数字。For the available error numbers you can use, please see the net error list.有关您可以使用的可用错误编号,请参阅网络错误列表。
statusCodenumber (optional) - The HTTP response code, default is 200.HTTP响应代码,默认为200。
charsetstring (optional) - The charset of response body, default is "utf-8".响应主体的字符集,默认为"utf-8"。
mimeTypestring (optional) - The MIME type of response body, default is "text/html". 响应正文的MIME类型,默认为"text/html"。Setting mimeType would implicitly set the content-type header in response, but if content-type is already set in headers, the mimeType would be ignored.设置mimeType会隐式设置响应中的content-type标头,但如果headers中已经设置了content-type,则会忽略mimeType。
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. 响应主体。当返回流作为响应时,这是一个Node.js可读流,表示响应主体。When returning Buffer as response, this is a Buffer. When returning string as response, this is a string. 当返回Buffer作为响应时,这是一个Buffer。当返回string作为响应时,这是一个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 url and pipe the result as response body. 下载url并将结果作为响应主体进行管道传输。This is only used for URL responses.这仅用于URL响应。
referrerstring (optional) - The referrer URL. This is only used for file and URL responses.referrerURL。这仅用于文件和URL响应。
methodstring (optional) - The HTTP method. HTTPmethod。This is only used for file and URL responses.这仅用于文件和URL响应。
sessionSession (optional) - The session used for requesting URL, by default the HTTP request will reuse the current session. 用于请求URL的会话,默认情况下,HTTP请求将重用当前会话。Setting session to null would use a random independent session. 将session设置为null将使用随机的独立会话。This is only used for URL responses.这仅用于URL响应。
uploadDataProtocolResponseUploadData (optional) - The data used as upload data. 用作上传数据的数据。This is only used for URL responses when method is "POST".这仅用于method为"POST"时的URL响应。