ApiController.Created Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Created(String, Object) |
Creates a CreatedResult (201 Created) with the specified values. |
Created(Uri, Object) |
Creates a CreatedResult (201 Created) with the specified values. |
Created<T>(String, T) |
Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values. |
Created<T>(Uri, T) |
Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values. |
Created(String, Object)
Creates a CreatedResult (201 Created) with the specified values.
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedResult Created (string location, object content);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Created : string * obj -> Microsoft.AspNetCore.Mvc.CreatedResult
override this.Created : string * obj -> Microsoft.AspNetCore.Mvc.CreatedResult
Public Overridable Function Created (location As String, content As Object) As CreatedResult
Parameters
- location
- String
The location at which the content has been created. Must be a relative or absolute URL.
- content
- Object
The content value to format in the entity body.
Returns
A CreatedResult with the specified values.
- Attributes
Applies to
Created(Uri, Object)
Creates a CreatedResult (201 Created) with the specified values.
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedResult Created (Uri uri, object content);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member Created : Uri * obj -> Microsoft.AspNetCore.Mvc.CreatedResult
override this.Created : Uri * obj -> Microsoft.AspNetCore.Mvc.CreatedResult
Public Overridable Function Created (uri As Uri, content As Object) As CreatedResult
Parameters
- uri
- Uri
The location at which the content has been created.
- content
- Object
The content value to format in the entity body.
Returns
A CreatedResult with the specified values.
- Attributes
Applies to
Created<T>(String, T)
Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values.
protected internal System.Web.Http.Results.CreatedNegotiatedContentResult<T> Created<T> (string location, T content);
member this.Created : string * 'T -> System.Web.Http.Results.CreatedNegotiatedContentResult<'T>
Protected Friend Function Created(Of T) (location As String, content As T) As CreatedNegotiatedContentResult(Of T)
Type Parameters
- T
The type of content in the entity body.
Parameters
- location
- String
The location at which the content has been created.
- content
- T
The content value to negotiate and format in the entity body.
Returns
A CreatedNegotiatedContentResult<T> with the specified values.
Applies to
Created<T>(Uri, T)
Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values.
protected internal virtual System.Web.Http.Results.CreatedNegotiatedContentResult<T> Created<T> (Uri location, T content);
abstract member Created : Uri * 'T -> System.Web.Http.Results.CreatedNegotiatedContentResult<'T>
override this.Created : Uri * 'T -> System.Web.Http.Results.CreatedNegotiatedContentResult<'T>
Protected Friend Overridable Function Created(Of T) (location As Uri, content As T) As CreatedNegotiatedContentResult(Of T)
Type Parameters
- T
The type of content in the entity body.
Parameters
- location
- Uri
The location at which the content has been created.
- content
- T
The content value to negotiate and format in the entity body.
Returns
A CreatedNegotiatedContentResult<T> with the specified values.