call
http.when('api/1').call(config => {});
The config object contains information such as the method, url, and headers.
If you match a url with a regular expression, any captured groups can be accessed via the match
array property.
http.when('post', /^api\/(\d+)\/upload$/).call(function({method, url, match}){
method === 'post';
url === 'api/123/upload';
match[0] === url;
match[1] === '123';
});