Currently, I have a setup where my web server is housed inside a virtual machine, with the client located outside of it.
On the server side, I am utilizing .NET Framework 4.6.1 for development.
Below is the architecture of my WEB API controller on the server-side:
// GET: api/Users
public IQueryable<Users> GetUsers()
{
db.Configuration.ProxyCreationEnabled = false;
return db.Users;
}
// GET: api/Users/5
[ResponseType(typeof(Users))]
public IHttpActionResult GetUsers(string id)
{
db.Configuration.ProxyCreationEnabled = false;
Users users = db.Users.Find(id);
if (users == null)
{
return NotFound();
}
return Ok(users);
}
When I access http://localhost:50347/api/Users/id from the browser within the virtual machine, IIS express responsds correctly.
On the client side, the request is made like this using TypeScript:
login(account: Account): Observable<Utente> {
let apiURL = `${URL.LOGIN}/${account.username}`;
return this.http.get<Utente>(apiURL);
Specifically, it calls .
However, when attempting to directly access from the browser, it results in an error message:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
Any assistance on resolving this issue would be greatly appreciated. Thank you in advance.