How to post json ajax request to web API
<p>I'm unable to get json data from server side. The script calls the server method but no json data returned.</p>

<pre><code>$(document).ready(function() {
    $("#SendMail").click(function() {
        $.ajax({
            url: "http://localhost:2457/SendMail/SendMail/",
            dataType: 'json',
            type: 'POST',
            data: "{htmlTemplate:" + "ABC" + "}",
            //crossDomain: true,
            //contentType: "application/json; charset=utf-8",
            success: function(data, textStatus, xhr) {
                console.log(data);
                alert('Successfully called');
            },
            error: function(xhr, textStatus, errorThrown) {
                // console.log(errorThrown);

            }
        });
    });
});

 Function SendMail(htmlTemplate As String) As String
      Dim fname As String = Request.Form("htmlTemplate1")
      Dim lname As String = Request.Form("lname")
      Dim cmdSendMail As New SendMailCommand()
      Return "A"
    End Function
</code></pre>