I have an api that return a json string.
An ashx file
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "application/json";
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
string result = string.Empty;
result = "{\"status\": \"OK\"}";
context.Response.Write(result);
}
I want to hidden the string {“status”: “OK”} on webpage response and the client can get this string.
Thanks.
Thanks
Once you get the string to the client code you can convert it to a javascript object, erase the attributes you don’t want and stringify again to show it.
You can also strip the text you don’t want by using string manipulation methods, however I think the first approach is more elegant.