## fetcher module

Utilities for fetching data from api server using fetch polyfill.
Fetcher adds neccessery headers, stringifies query and body params and calls endpoint.
All methods returns promise.

Examples:
```javascript
 fetcher.get('some/api/', auth.token, {_order_by: 'modified_at desc'});
 fetcher.post('some/api/login', null, {username, password});
 fetcher.put('some/api/docs/1', auth.token, {id: 1, company: 'abc doo', });
 fetcher.delete('some/api/docs/1', auth.token);
```


Using with promises:
```javascript
 fetcher.get('some/api').then(
   response => {
     // handle HTTP response
   }, error => {
     // handle network error
 });
```

Using generic fetch:
```javascript
 fetcher.fetch(url, options)
```

 `options` attributes are:
   method (String) - HTTP request method. Default: "GET"
   body (String, body types) - HTTP request body
   headers (Object, Headers) - Default: {}
   credentials (String) - Authentication credentials mode. Default: "omit"
       "omit" - don't include authentication credentials (e.g. cookies) in the request
       "same-origin" - include credentials in requests to the same site
       "include" - include credentials in requests to all sites
For nice intro to fetch web api see https://davidwalsh.name/fetch
and https://github.github.io/fetch/ for the reference.

