You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>/// Returns an Allow HTTP header with the allowed HTTP methods./// </summary>/// <returns>A 200 OK response.</returns>[HttpOptions][SwaggerResponse(StatusCodes.Status200OK,"The allowed HTTP methods.")]publicIActionResultOptions(){this.HttpContext.Response.Headers.AppendCommaSeparatedValues(HeaderNames.Allow,HttpMethods.Get,HttpMethods.Head,HttpMethods.Options,HttpMethods.Post);returnthis.Ok();}/// <summary>/// Returns an Allow HTTP header with the allowed HTTP methods for a car with the specified unique identifier./// </summary>/// <param name="carId">The cars unique identifier.</param>/// <returns>A 200 OK response.</returns>[HttpOptions("{carId}")][SwaggerResponse(StatusCodes.Status200OK,"The allowed HTTP methods.")]publicIActionResultOptions(intcarId){this.HttpContext.Response.Headers.AppendCommaSeparatedValues(HeaderNames.Allow,HttpMethods.Delete,HttpMethods.Get,HttpMethods.Head,HttpMethods.Options,HttpMethods.Patch,HttpMethods.Post,HttpMethods.Put);returnthis.Ok();}
The text was updated successfully, but these errors were encountered:
Are OPTIONS action needed for CORS pre-flight requests?
See here: https://github.com/Dotnet-Boxed/Templates/blob/master/Source/Content/ApiTemplate/Controllers/CarsController.cs#L24-L64
The text was updated successfully, but these errors were encountered: