I’m using Angular HttpClient to make a post request to the server and I’m getting the following error:
Cross-Origin Read Blocking (CORB) blocked cross-origin response http://localhost:3000/api/users with MIME type application/json. See Chrome Platform Status for more details.
When I check the console I get null
in the response of the request, but when I check the network tab I get 200 status code and the user is registered in the database.
Nothing back in the response as I mentioned:
My service.ts code:
export class UsersService {
constructor(private http: HttpClient) {}
register(user) {
this.http
.post(apiEndPoint + "/users", {
email: user.username,
password: user.password,
name: user.name
})
.subscribe(res => console.log(res), ex => console.log(ex));
}
}
New to Angular world, facing difficulties with this HttpClient Module :/, any help greatly appreciated.