title: How can i write function that trigger/refresh a http post method programatically?
body: <p>How can i write a method in far far away component,when forexample i click a button and this post method subscribe will run again? I think with a service i should get here...It(this.qwe) has not to be in constructor its just an eaxample...</p>
  <pre><code>  import { Component, OnInit } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  
  @Component({
    selector: 'post-request',
    templateUrl: 'post-request.component.html',
  })
  export class PostRequestComponent {
    postId;
  
    constructor(private http: HttpClient) {
        this.qwe()
    }
    
  
    qwe() {
      this.http
        .post&lt;any&gt;('https://reqres.in/api/posts', {
          title: 'Angular POST Request Example',
        })
        .subscribe((data) =&gt; {
          this.postId = data.id;
        });
    }
  }
  </code></pre>