Skip to content

Produces<string>() should default to "text/plain" rather than "application/json" #43979

@halter73

Description

@halter73

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Produces<string>() defaults to "application/json" like it does for all calls that don't explicitely specify the Content-Type.

if (responseType is Type && string.IsNullOrEmpty(contentType))
{
contentType = "application/json";
}

This is unintuitive behavior.

Expected Behavior

string should be special-cased to default to a "text/plain" content-type instead.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

See #43961 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    old-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions