I am accessing a third party service through the HttpClient of Angular.
Before writing the code I made some test with Postman , if could access this third party service. And I notice that i have to set Referer to name of domain of the third pary in order to get a successful response from the third party. So in order to get a successful response I should tell the third party that this request is originating from a specific url.
The problem is that i cannot set the Referer header from angular. Is it possible to set the Referer Header from angular? How can i achieve to modify the Referer Header? I have simplified the code by removing the business logic. Below is what i am trying to do to achieve this.
var serviceUrl = "https://xxx.yyy.zzz";
let httpOptions = {
headers: new HttpHeaders({
'Referer': 'https://xx.yyy.xx'
})
};
let formData = new FormData();
formData.append("x","z");
formData.append("y","z");
this.httpClient.post(serviceUrl,formData,httpOptions).subscribe(response => {
console.log(response);
});
