title: common code to handle http method like get, put, post, delete
body: <p>With <code>angularjs or angular-1</code>, I used to have common code (not exactly) to handle <code>http methods like GET, PUT, POST, DELETE</code>,</p>
  
  <pre><code>// can be called with GET, PUT, POST, DELETE
  
  sharedService.process(method, url, data, headers).then(function(result){
  
       //handle response here
       .....
  
  })
  </code></pre>
  
  <p><strong>sharedservice.js</strong></p>
  
  <pre><code>// this would handle all types of requests. eg. GET, PUT, POST, DELETE
  
  process: function (method, url, data, header){
    ...
    ...
    return $http({
            method  : method,
            url     : url,
            headers : headers,
            data    : data
     })
    ...
    ...
  }
  </code></pre>
  
  <p>How to achieve the same in angular 2/4/5?<bR>
  Is there any way to achieve it with <code>promise</code> or <code>observable</code> response?<br>
  Is there any common way to handle HTTP methods ?</p>