request.end([data[, encoding]][, callback])
-
data
<string> | <Buffer> | <Uint8Array> -
encoding
<string> -
callback
<Function> -
返回:<this>
¥Returns: <this>
完成发送请求。如果正文的任何部分未发送,则会将它们刷新到流中。如果请求被分块,则将发送终止的 '0\r\n\r\n'
。
¥Finishes sending the request. If any parts of the body are
unsent, it will flush them to the stream. If the request is
chunked, this will send the terminating '0\r\n\r\n'
.
如果指定了 data
,则相当于调用 request.write(data, encoding)
后跟 request.end(callback)
。
¥If data
is specified, it is equivalent to calling
request.write(data, encoding)
followed by request.end(callback)
.
如果指定了 callback
,则将在请求流完成时调用。
¥If callback
is specified, it will be called when the request stream
is finished.