I'm trying to post a json and handle the response but all I get is these errors:
zone-evergreen.js:2952 OPTIONS http://'api':10050/api/content/Delivery net::ERR_EMPTY_RESPONSE
core.js:6014 ERROR HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error", url: "http://'api':10050/api/content/Delivery", ok: false, …}
I saw a lot of cases on stackoverflow and tried everything but nothing worked, when i try passing it through postman it works perfectly.
service:
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
@Injectable()
export class HttpService {
  private headers: HttpHeaders;
  private accessPointUrl: string = 'http://'api':10050/api/content/Delivery';
  constructor(private http: HttpClient) {
    this.headers = new HttpHeaders({'Content-Type': 'application/json; charset=utf-8'});
  }
  public get(payload){
    return this.http.get(this.accessPointUrl+ payload, {headers: this.headers});
  }
  public add(payload) {
    console.log(payload)
    return this.http.post(this.accessPointUrl, payload, {headers: this.headers});
}}
ts:
onSubmit(){
let json= JSON.stringify({
Name: "StackoverFlow"
})
 this.http.add(json).subscribe((data:any)=>{
console.log(data)
})
I tried everything and I'm really stuck, thank you in advance.
 
    