new MockRequest(method, url, props)
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
method |
string |
<optional> |
GET | HTTP method |
url |
url |
<optional> |
/ | URL |
props |
object |
<optional> |
{} | Additional properties, like |
- Source:
-
_setSource(src, cb)
-
Set the source data or stream
Parameters:
Name Type Argument Description src
object | string | Buffer | null Source, stream or static data
cb
function | boolean <optional>
Pass true or a callback fn and all data from the source stream will be pulled upfront, having the Content-Length header set accordingly, if there is no such header already. Signature:
fn(err, length)
, whereerr
is any potential Error as emitted by the source stream.length
is provided in any case and shows how much data has been read.- Source:
-
setTimeout()
-
- Source: