title: Cancel a HTTP request
body: <p>I would like to know if there is any way I could check if a HTTP get is in pending status and if there is a way to cancel my HTTP get? </p>
  
  <p>This is my HTTP get: </p>
  
  <pre><code>public getData(): Observable&lt;any&gt; {
     return this.httpClient.get('http://IP_ADRESS:3490/testStream', {responseType: 'arraybuffer', observe: 'response' }});
  }
  
  public putData(): void {
     this.getData().subscribe((resp) =&gt; {
       console.log(resp);
       const responseArray: Uint8ClampedArray = new Uint8ClampedArray(resp);
       const newTabTemp: Uint8ClampedArray = new Uint8ClampedArray(this.maxHeight * this.maxWidth * 4);
       let comp = 0;
       for (let i = 0; i &lt; this.maxHeight * this.maxWidth * 4; i = i + 4) {
         newTabTemp[i] = responseArray[comp];
         newTabTemp[i + 1] = responseArray[comp];
         newTabTemp[i + 2] = responseArray[comp];
         newTabTemp[i + 3] = 255;
         comp = comp + 1;
       }
       let nouvData: ImageData;
       nouvData = new ImageData(newTabTemp, this.maxWidth, this.maxHeight);
       this.contextVideo.putImageData(nouvData, BORDERX / 2, BORDERY / 2);
     });
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3ORG1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ORG1.jpg" alt="Request taking to much time"></a>
  <a href="https://i.stack.imgur.com/1YEGC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1YEGC.png" alt="Request never suceeding"></a></p>
  
  <p>I'm getting a lot of these pending requests that never succeed or that take a long time to. How can I check if they're pending and cancel them?</p>