POST api/Categories

Request Information

URI Parameters

None.

Body Parameters

CategoryViewModel
NameDescriptionTypeAdditional information
CategoryId

integer

None.

Name

string

Required

String length: inclusive between 0 and 25

Description

string

Required

String length: inclusive between 0 and 25

Request Formats

application/json, text/json

Sample:
{
  "CategoryId": 1,
  "Name": "sample string 2",
  "Description": "sample string 3"
}

application/xml, text/xml

Sample:
<CategoryViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ToDoAPI.API.Models">
  <CategoryId>1</CategoryId>
  <Description>sample string 3</Description>
  <Name>sample string 2</Name>
</CategoryViewModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CategoryViewModel'.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.