title: What is the right way to use angular2 http requests with Django CSRF protection?
body: <p>In Angular1 the problem can be solved by configuring $http-provider. Like:</p>
  
  <pre><code>app.config(function($httpProvider) {
    $httpProvider.defaults.xsrfCookieName = 'csrftoken';
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
  });
  </code></pre>
  
  <p>What is a good practice to do the same in Angular2?</p>
  
  <p>In Angular2 to work with http requests we need to use class Http. Of course that's not a good practice to add CSRF-line to each call of post-function.</p>
  
  <p>I guess in Angular2 I should create own class that inherits Angular2's Http class and redefine the post-function. Is it the right approach or is there a more elegant method?</p>