POST api/Authors

Request Information

URI Parameters

None.

Body Parameters

Author
NameDescriptionTypeAdditional information
Id

integer

None.

FirstName

string

Required

String length: inclusive between 0 and 50

LastName

string

Required

String length: inclusive between 0 and 50

Book

Collection of Book

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "FirstName": "sample string 2",
  "LastName": "sample string 3",
  "Book": [
    {
      "Id": 1,
      "Title": "sample string 2",
      "ISBN": "sample string 3",
      "ShelfId": 4,
      "ImageLink": "sample string 5",
      "Description": "sample string 6",
      "Shelf": {
        "Id": 1,
        "Name": "sample string 2",
        "Designation": "sample string 3",
        "Book": []
      },
      "Author": []
    },
    {
      "Id": 1,
      "Title": "sample string 2",
      "ISBN": "sample string 3",
      "ShelfId": 4,
      "ImageLink": "sample string 5",
      "Description": "sample string 6",
      "Shelf": {
        "Id": 1,
        "Name": "sample string 2",
        "Designation": "sample string 3",
        "Book": []
      },
      "Author": []
    }
  ]
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Objektdiagram för typ System.Collections.Generic.List`1[[BookAPI.Author, BookAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] innehåller cykler och kan inte serialiseras om referensspårning har inaktiverats.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Objektdiagram för typ System.Collections.Generic.List`1[[BookAPI.Author, BookAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] innehåller cykler och kan inte serialiseras om referensspårning har inaktiverats.

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

Response Information

Resource Description

Author
NameDescriptionTypeAdditional information
Id

integer

None.

FirstName

string

Required

String length: inclusive between 0 and 50

LastName

string

Required

String length: inclusive between 0 and 50

Book

Collection of Book

None.

Response Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "FirstName": "sample string 2",
  "LastName": "sample string 3",
  "Book": [
    {
      "Id": 1,
      "Title": "sample string 2",
      "ISBN": "sample string 3",
      "ShelfId": 4,
      "ImageLink": "sample string 5",
      "Description": "sample string 6",
      "Shelf": {
        "Id": 1,
        "Name": "sample string 2",
        "Designation": "sample string 3",
        "Book": []
      },
      "Author": []
    },
    {
      "Id": 1,
      "Title": "sample string 2",
      "ISBN": "sample string 3",
      "ShelfId": 4,
      "ImageLink": "sample string 5",
      "Description": "sample string 6",
      "Shelf": {
        "Id": 1,
        "Name": "sample string 2",
        "Designation": "sample string 3",
        "Book": []
      },
      "Author": []
    }
  ]
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Objektdiagram för typ System.Collections.Generic.List`1[[BookAPI.Author, BookAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] innehåller cykler och kan inte serialiseras om referensspårning har inaktiverats.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Objektdiagram för typ System.Collections.Generic.List`1[[BookAPI.Author, BookAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] innehåller cykler och kan inte serialiseras om referensspårning har inaktiverats.