Cześć,
Potrzebuję pomocy w zapewne trywialnym problemie.
Napisałem proste API w .net core.
Gdy odpalam lokalnie - działają wszystkie metody
Zrobiłem deploy na hosting webio.pl i nie działa mi jedynie metoda PUT.
W odpowiedzi po kilku sekundach dostaje: status: 408
Request Timeout
To samo w postmanie i mojej apce front-endowej
Nie jest to problem bazy, bo lokalnie jestem tez połączony z bazą na hostingu.
KOD (dodałem tez post - który działa):
```
// POST: api/Notes
[Authorize]
[HttpPost]
public IActionResult Post([FromBody] NotesModel NewNote)
{
var identity = HttpContext.User.Identity as ClaimsIdentity;
var userid = identity.FindFirst(ClaimTypes.Name).Value;
int Userid = Int32.Parse(userid);
if (!ModelState.IsValid)
{
return BadRequest();
}
try
{
return Ok(NotesRepository.AddNote(NewNote, Userid));
}
catch (Exception ex)
{
return BadRequest($"Failed: {ex}");
}
}
// PUT: api/Notes/5
[Authorize]
[HttpPut("{id}")]
public IActionResult Put(int id, [FromBody] NotesModel NoteEdited)
{
var identity = HttpContext.User.Identity as ClaimsIdentity;
var userid = identity.FindFirst(ClaimTypes.Name).Value;
int Userid = Int32.Parse(userid);
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
try
{
return Ok(NotesRepository.EditNote(id, NoteEdited, Userid));
}
catch (Exception ex)
{
return BadRequest($"Failed: {ex}");
}
}