以字符串c#.net的形式获取响应

以字符串c#.net的形式获取响应

问题描述:

我在页面加载事件中使用c#.net创建了网站

i have created the website with c#.net in a page load event as

protected void Page_Load(object sender, EventArgs e)
    {

        string s = "completed.";
        byte[] bytes = System.Text.Encoding.UTF8.GetBytes(s);

        Response.OutputStream.Write(bytes, 0, bytes.Length);
    }

当我通过浏览器运行时,得到的正确响应为

when i am running through browser i am getting a correct response as

Completed.

现在我的问题是,当我通过其余客户端运行相同的URL时,我得到的响应Nody [raw]为

Now my question is when i run the same url through rest client i am getting the Response nody[raw] as

completed.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head><title>

</title></head>

<body>
    <form method="post" action="Default.aspx" id="form1">

<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZJy1PJCY5kS9nkQAfBTgrw0zeG/yMEs2VJP+7kbHC2Yp" />
</div>    <div> </div>    </form></body></html>

但是我只需要完成即可.作为回应

but i need to get only completed. as response

怎么可能?

等待您的宝贵意见和建议

Waiting for your valuable comments and suggestions

尝试使用:

Response.Clear();
Response.OutputStream.Write(bytes, 0, bytes.Length); 
Response.End();