title: HTTP Get not working on Angular
body: <p>I'm working on an application where I have a client in Angular and my server is in C. I have a problem with my HTTP Get but I can't find it. "updateStream()" is called every 70 ms.</p>
  
  <pre><code>public updateStream(): void {
     if (this.isVideoRunning &amp;&amp; this.canChangePicture) {
       console.log('put is called');
       this.putData();
     }
  }
  
  public getData(): Observable&lt;any&gt; {
     return this.httpClient.get('http://IP_ADRESS:3490/testStream', { responseType: 'arraybuffer' })
  }
  
  public putData(): void {
     console.log('put function');
     this.canChangePicture = false;
     let comp: number;
     this.getData().subscribe((resp) =&gt; {
        console.log(resp);
        const responseArray: Uint8ClampedArray = new Uint8ClampedArray(resp);
        const newTabTemp: Uint8ClampedArray = new Uint8ClampedArray(this.maxHeight * this.maxWidth * 4);
        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);
    this.canChangePicture = true;
    });
  }
  </code></pre>
  
  <p>My problem was that my canvas would almost never change so I tried to put some "console.log" and I discovered that the problem is somehow my program would not enter in "this.getData().subscribe()..." after a few request. </p>
  
  <p><a href="https://i.stack.imgur.com/3JT0u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3JT0u.png" alt=" Those are my console.log"></a></p>
  
  <p>As you can see my program keep entering "putData()" but not the "this.getData().subscribe()...". What is wrong with my code and how I fix it?</p>
  
  <p>EDIT:</p>
  
  <p>Screenshot of the pending request
  <a href="https://i.stack.imgur.com/Kt0vj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kt0vj.png" alt="Pending request"></a>
  timing tab: <a href="https://i.stack.imgur.com/IvU89.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IvU89.png" alt="Timing tab"></a>
  Request/response
  <a href="https://i.stack.imgur.com/qndUD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qndUD.png" alt="enter image description here"></a></p>