1POST http://localhost:60464/api/student?age=15 HTTP/1.1
2User-Agent: Fiddler
3Host: localhost:60464
4Content-Type: application/json
5Content-Length: 13
6
7{
8 id:1,
9 name:'Steve'
10}
11
1public class Student
2{
3 public int Id { get; set; }
4 public string Name { get; set; }
5}
6
7public class StudentController : ApiController
8{
9 public Student Post(Student student)
10 {
11 // save student into db
12 var insertedStudent = SaveStudent(student);
13
14 return insertedStudent;
15 }
16}
17
1GET http://localhost:60464/api/student HTTP/1.1
2User-Agent: Fiddler
3Host: localhost:1234
4Accept: application/json
5