0
votes

I am very new to service stack. Just create a very sample demo rightnow.

I have passed the Object of class when posting the data. My question is How service stack handles the Object when Posting the request.i.e. JSON/XML etc.

   JsonServiceClient client = new JsonServiceClient("http://localhost/RestIntro");

        Customer c = new Customer();
        c.Name = "Amit patel";
        c.Age = 30;
        c.Email = "aa";

        var res = client.Post<Customer>("/customers", c);

How does this c (Object of Customer) handles when transferring the data?

1

1 Answers

0
votes

I assume the this is the JsonService

As you can see, the service just serialises the customer object, using the BclJsonDataContractSerializer, which uses a datacontractjsonserializer, and posts it a json.