我有返回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;