Contains constants and functions for a Network Request.
The structure for a Network Request is as follows:
{
payload: {
body: <object>,
initiator: <string>,
location: {
domain: <string>,
hash: <string>,
host: <string>,
hostname: <string>,
origin: <string>,
path: <string>,
port: <string>,
protocol: <string>,
query: <string>,
},
method: <string>,
requestId: <string>,
url: <string>,
},
type: 'netreq'
annotations: <array>,
clientId: <string>,
timestamp: <number>,
uuid: <string>,
}
- Source:
Members
(static, constant) group
A grouping for this object
- Source:
(static, constant) label
A label that can be used when describing this object
- Source:
(static, constant) matcher
Matcher can be used to find matching Network Request objects.
- Source:
- See:
-
- kit.match
(static, constant) parentDepth
Describes the number of parents this object has based off schema references. When checking for matches for example, we want to use a schema that is more specific over a more generic schema
- Source:
(static, constant) path :string
Paths for the keys on a Network Request
Properties:
Name | Type | Description |
---|---|---|
payload |
string |
An object with custom data describing the event. |
body |
string |
The posted body. This is a fully parsed object.. |
initiator |
string |
The webpage that initiated the request.. |
location |
string |
Parsed information from the request URL.. |
domain |
string |
The domain portion of the request URL.. |
hash |
string |
The hash portion of the request URL.. |
host |
string |
The host portion of the request URL. Includes port number. |
hostname |
string |
The host portion of the request URL without the port number.. |
origin |
string |
The origin portion of the request URL.. |
path |
string |
The path of the request URL.. |
port |
string |
The port of the request URL.. |
protocol |
string |
The protocol portion of the request URL.. |
query |
string |
The query string portion of the request URL.. |
method |
string |
HTTP method that the request is made with.. |
requestId |
string |
ID that can be used to pair requests with responses.. |
url |
string |
The URL the request is being made to. Contains the full host, path, and query string.. |
rootType |
string |
The type of event. For network requests it's always 'netreq'.. |
annotations |
string |
Array of Annotation objects. |
clientId |
string |
A unique id that differentiates clients from one another. |
timestamp |
string |
When the event occurred. |
rootId |
string |
Uniquely identifies each event. |
- Source:
(static, constant) ROOT_TYPE
The value for rootType
for a Network Request.
Path is type
.
- Source:
Methods
(static) get(alias, data) → {*}
Retrieves a value from the object. You can provide either a path or an alias.
Parameters:
Name | Type | Description |
---|---|---|
alias |
string |
Path or alias |
data |
* |
Data to search |
- Source:
(static) getBody(source) → {object}
Returns the body
from the Network Request.
This is the the posted body. This is a fully parsed object..
Path is payload,body
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getBodyKey(…path, source) → {*}
Returns the data using the specified path from the body of the Network Request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string |
<repeatable> |
key in object |
source |
object |
The Network Request instance |
- Source:
(static) getDomain(source) → {string}
Returns the domain
from the Network Request.
This is the the domain portion of the request URL..
Path is payload,location,domain
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getHash(source) → {string}
Returns the hash
from the Network Request.
This is the the hash portion of the request URL..
Path is payload,location,hash
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getHost(source) → {string}
Returns the host
from the Network Request.
This is the the host portion of the request URL. Includes port number.
Path is payload,location,host
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getHostname(source) → {string}
Returns the hostname
from the Network Request.
This is the the host portion of the request URL without the port number..
Path is payload,location,hostname
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getInitiator(source) → {string}
Returns the initiator
from the Network Request.
This is the the webpage that initiated the request..
Path is payload,initiator
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getLocation(source) → {object}
Returns the location
from the Network Request.
This is the parsed information from the request URL..
Path is payload,location
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getLocationKey(…path, source) → {*}
Returns the data using the specified path from the location of the Network Request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string |
<repeatable> |
key in object |
source |
object |
The Network Request instance |
- Source:
(static) getMethod(source) → {string}
Returns the method
from the Network Request.
This is the hTTP method that the request is made with..
Path is payload,method
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getOrigin(source) → {string}
Returns the origin
from the Network Request.
This is the the origin portion of the request URL..
Path is payload,location,origin
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getPath(source) → {string}
Returns the path
from the Network Request.
This is the the path of the request URL..
Path is payload,location,path
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getPort(source) → {string}
Returns the port
from the Network Request.
This is the the port of the request URL..
Path is payload,location,port
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getProtocol(source) → {string}
Returns the protocol
from the Network Request.
This is the the protocol portion of the request URL..
Path is payload,location,protocol
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getQuery(source) → {string}
Returns the query
from the Network Request.
This is the the query string portion of the request URL..
Path is payload,location,query
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getRequestId(source) → {string}
Returns the requestId
from the Network Request.
This is the iD that can be used to pair requests with responses..
Path is payload,requestId
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getRootType(source) → {string}
Returns the rootType
from the Network Request.
This is the the type of event. For network requests it's always 'netreq'..
Path is type
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) getUrl(source) → {string}
Returns the url
from the Network Request.
This is the the URL the request is being made to. Contains the full host, path, and query string..
Path is payload,url
.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
(static) isMatch(source) → {boolean}
Tests the provided source against the matcher to see if it's Network Request event.
Parameters:
Name | Type | Description |
---|---|---|
source |
object |
The Network Request instance |
- Source:
- See:
-
- kit.isMatch
(static) make(…input) → {object}
Generates a Network Request with the const values set. Can be useful in testing. Can provide additional data by providing a flat object of paths and values.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
input |
function |
<repeatable> |
Overrides |
- Source:
(static) mock(…input) → {object}
Generates a Network Request with some default values set. Can be useful in testing. Can override defaults and provide additional data by providing a flat object of paths and values.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
input |
function |
<repeatable> |
Overrides |
- Source: