public async Task <IActionResult> OnPost() { HttpRequests req = new HttpRequests(); Object place = new { name = Name, zipCode = ZipCode, city = City, street = Street, country = Country, placeTypeID = Placetype }; Place p = await req.CreatePlaceAsync(place, BaseController.GetToken()); return(RedirectToPage("/PlaceSite", new { id = Convert.ToInt32(p.ID) })); }