Microsoft.AspNetCore.Http.BadHttpRequestException: Failed to read parameter "RegisterRequest registration" from the request body as JSON. ---> System.Text.Json.JsonException: JSON deserialization for type 'Microsoft.AspNetCore.Identity.DTO.RegisterRequest' was missing required properties, including the following: password at System.Text.Json.ThrowHelper.ThrowJsonException_JsonRequiredPropertyMissing(JsonTypeInfo parent, BitArray requiredPropertiesSet) at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)`
I tried this const data = { registration: { email: '[email protected]', password:'asdfghjkj' } }; const response = await fetch('https://localhost:7290/register', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': '*/*' }, body: JSON.stringify(data)
N0ThinG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.