POST api/recipe/SaveRecipe

Add / Modify recipe details

Request Information

URI Parameters

None.

Body Parameters

RecipeViewModel
NameDescriptionTypeAdditional information
RecipeId

integer

None.

RecipeName

string

Required

Description

string

None.

ImagePath

string

None.

Ingredients

Collection of IngredientViewModel

None.

Request Formats

application/json, text/json

Sample:
{
  "RecipeId": 1,
  "RecipeName": "sample string 2",
  "Description": "sample string 3",
  "ImagePath": "sample string 4",
  "Ingredients": [
    {
      "IngredientId": 1,
      "IngredientName": "sample string 2",
      "Amount": 3.1
    },
    {
      "IngredientId": 1,
      "IngredientName": "sample string 2",
      "Amount": 3.1
    }
  ]
}

application/xml, text/xml

Sample:
<RecipeViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/App.Data.Model">
  <Description>sample string 3</Description>
  <ImagePath>sample string 4</ImagePath>
  <Ingredients>
    <IngredientViewModel>
      <Amount>3.1</Amount>
      <IngredientId>1</IngredientId>
      <IngredientName>sample string 2</IngredientName>
    </IngredientViewModel>
    <IngredientViewModel>
      <Amount>3.1</Amount>
      <IngredientId>1</IngredientId>
      <IngredientName>sample string 2</IngredientName>
    </IngredientViewModel>
  </Ingredients>
  <RecipeId>1</RecipeId>
  <RecipeName>sample string 2</RecipeName>
</RecipeViewModel>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

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

Sample:

Sample not available.