KestrunResponse.WriteFormUrlEncodedResponseAsync method

Asynchronously writes a form-urlencoded response with the specified input object, status code, and optional content type. Automatically converts the input object to a Dictionary{string, string} using ObjectToDictionaryConverter.

public Task WriteFormUrlEncodedResponseAsync(object? inputObject, int statusCode = 200)
parameter description
inputObject The object to be converted to form-urlencoded data. Can be a dictionary, enumerable, or any object with public properties.
statusCode The HTTP status code for the response. Defaults to 200 OK.

See Also