示例#1
0
 // POST: api/Person
 public Person Post([FromBody] Person person)
 {
     Debug.WriteLine("Zapytanie Post");
     Debug.WriteLine(person.Name);
     if (!phoneBook.AddNewPerson(person))
     {
         var response = new HttpResponseMessage(HttpStatusCode.NotFound)
         {
             Content = new StringContent("Unable to find any results")
         };
         throw new HttpResponseException(response);
     }
     return(person);
 }