POST api/ToDo

Request Information

URI Parameters

None.

Body Parameters

ToDoViewModel
NameDescriptionTypeAdditional information
ToDoId

integer

None.

Action

string

Required

Done

boolean

Required

CategoryId

integer

Required

Category

CategoryViewModel

None.

Request Formats

application/json, text/json

Sample:
{
  "ToDoId": 1,
  "Action": "sample string 2",
  "Done": true,
  "CategoryId": 4,
  "Category": {
    "CategoryId": 1,
    "Name": "sample string 2",
    "Description": "sample string 3"
  }
}

application/xml, text/xml

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

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 'ToDoViewModel'.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

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

Sample:

Sample not available.