Asmx Returning Pure Json

I found out that asmx file in asp.net only returns pure JSON when  called from ajax and specified content in Headers e.g contentType = "applicaton/json; charset=utf-8"