Seria 3 pytań uczestników, które pojawiły się podczas szkolenia Tworzenie usług sieciowych REST API w technologii ASP.NET WebAPI realizowanego w dniach 23-25.09.2019 r.
W takim przypadku należy dodać parametr host-header: ngrok http -host-header=""localhost:[port]"" [port]"
Zgodnie z zasadami REST API nie jest prawidłowy. Powinien wyglądać następująco: DELETE /api/customers/3 Inne przykłady: nieprawidłowe: GET /api/customers/GetCustomers GET /api/customers?CustomerId=10 GET /api/customers?Name=vavatech GET /api/orders?CustomerName=vavatech&Year=2018 GET /api/customers/create?name=Vavatech&Street=Olesinska GET /api/customers/GetByCity?City=Lublin&Street=Dworcowa prawidłowe: GET /api/customers GET /api/customers/10 GET /api/customers/vavatech GET /api/customers/vavatech/orders GET /api/customers/vavatech/orders/2018 GET /api/customers?City=Lublin&Street=Dworcowa GET /api/orders POST /api/customers PUT /api/customers/Vavatech DELETE /api/customers/100
Należy zaimplementować interfejs IHttpActionResult
Na przyykład
public class AuthenticationFailureResult : IHttpActionResult
{
public Task