Thanks for the suggestion. I will check this one.
I would like to add that I checked the same page with apache on the same server and it is working fine with apache.
All i did was shifted from litespeed to apache from litespeed admin panel, then tested this page and it worked as expected. Don't know why it gives text/html header every time with litespeed.
I will post my findings..