Results.Created Method

Definition

Overloads

Created()

Source:
Results.cs

Produces a Status201Created response.

C#
public static Microsoft.AspNetCore.Http.IResult Created ();

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and ASP.NET Core 8.0
Product Versions
ASP.NET Core 8.0, 9.0

Created(String, Object)

Source:
Results.cs

Produces a Status201Created response.

C#
public static Microsoft.AspNetCore.Http.IResult Created (string uri, object? value);
C#
public static Microsoft.AspNetCore.Http.IResult Created (string? uri, object? value);

Parameters

uri
String

The URI at which the content has been created.

value
Object

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

Created(Uri, Object)

Source:
Results.cs

Produces a Status201Created response.

C#
public static Microsoft.AspNetCore.Http.IResult Created (Uri uri, object? value);
C#
public static Microsoft.AspNetCore.Http.IResult Created (Uri? uri, object? value);

Parameters

uri
Uri

The URI at which the content has been created.

value
Object

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

Created<TValue>(String, TValue)

Source:
Results.cs

Produces a Status201Created response.

C#
public static Microsoft.AspNetCore.Http.IResult Created<TValue> (string uri, TValue? value);
C#
public static Microsoft.AspNetCore.Http.IResult Created<TValue> (string? uri, TValue? value);

Type Parameters

TValue

Parameters

uri
String

The URI at which the content has been created.

value
TValue

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0

Created<TValue>(Uri, TValue)

Source:
Results.cs

Produces a Status201Created response.

C#
public static Microsoft.AspNetCore.Http.IResult Created<TValue> (Uri uri, TValue? value);
C#
public static Microsoft.AspNetCore.Http.IResult Created<TValue> (Uri? uri, TValue? value);

Type Parameters

TValue

Parameters

uri
Uri

The URI at which the content has been created.

value
TValue

The value to be included in the HTTP response body.

Returns

The created IResult for the response.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0