when(method, url, [data], [headers], [keys]);
Creates a new backend definition.
Parameters
Param | Type | Details |
---|---|---|
method | string | HTTP method. |
url | string RegExp function(string) | HTTP url or function that receives a url and returns true if the url matches the current definition. |
data (optional) | string RegExp | HTTP request body. |
headers (optional) | Object function(Object) | HTTP headers or function that receives http header object and returns true if the headers match the current definition. |
keys (optional) | Array | Array of keys to assign to regex matches in request url described on $httpBackend mock. |
Returns
requestHandler |
Returns an object with
|
Please login to continue.