Web API controller to get details of a travel plan or a leave request
I'd re-think your switch:


RequestBase LeaveInput = jsonSerializer.Deserialize&lt;RequestBase&gt;(content); is repeated, the only difference it is assigned to a different variable depending on the case. 
response.Content = new ObjectContent(typeof(object), travelOutput, jsonFormatter); is also repeated, with the only difference being the second parameter. 


In fact, the three lines of each case are virtually identical, except for repo.GetLeaveRequest() and repo.GetTravel(), which suggests to me that the switch should happen at a lower level.

Perhaps you could do something like this:

private ObjectContent GetObjectContent(string id, string content)
{
    var input = jsonSerializer.Deserialize&lt;RequestBase&gt;(content);

    object output;
    switch (id)
    {
        case "leave":           
            output = repo.GetLeaveRequest(LeaveInput);
            break;

        case "travel":
            output = repo.GetTravel(travelInput);
            break;
    }

    return new ObjectContent(typeof(object), output, jsonFormatter);
}


Thus the contents of your try could become:

var content = Request.Content.ReadAsStringAsync().Result;
var response = Request.CreateResponse();
response.Content = GetObjectContent(content);
return response;


Note that I'm not sure this works, consider it more like an idea than workable code. (I just don't feel like starting up VS to test this.)



Just a couple of quick remarks:


Local variables like LeaveInput and LeaveOutput should be camelCase.
You explicitly use RequestBase and HttpResponseMessage and Task&lt;LeaveForm&gt;: why not use var like elsewhere in your code?