Reputation: 331
I'm developing Angular app where user opens a URL (https://localhost:4200/bookingDone) fills the forms.
After that user clicks on PAY button and a POST request is fired to server to payment gate way with this
postBackURL: 'https://localhost:4200/oilChanger'
After creation of token on server. Server fires a GET call back to my angular app using url provided in postBackURL. How can I handle is call and route the UI to the oilChanger. I get this error in console:
core.js:1350 ERROR HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error", url: null, ok: false, …}
Now problem is that my corresponding Angular Page that I configured for that Callback URL is not opening. I configured /oilChanger page in RouteProvider, but that seems not to be working.
However, if I open the url directly via browser, it gets opened. my http call:
this.http.post('https://abcd.com/Index.jsf', body.toString(), options).subscribe(response => {
console.log(response)
});
How this scenario can be handled? Any help would be greatly appreciated.
Upvotes: 0
Views: 1919
Reputation: 944210
How to receive GET request in an AngularJS page?
You can't.
Angular is a client-side JavaScript framework.
HTTP requests are received by servers, not clients.
localhost
means "This computer" and the service making the postback request will have a different idea about what "this computer" is to your web browser.Upvotes: 3