我有返回 http 响应的代码,但它也包含页面的内容。我怎样才能从头开始创建一个响应,以便它除了我放入的内容之外不包含任何内容?
我现在的代码:
GCheckout.AutoGen.NotificationAcknowledgment response = new GCheckout.AutoGen.NotificationAcknowledgment();
response.serialnumber = serialNumber;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.BinaryWrite(GCheckout.Util.EncodeHelper.Serialize(response));
HttpContext.Current.Response.StatusCode = 200;