您好,我目前正在整合商家帐户系统。
我需要将 http 请求中的总字节数发送到我网站上的 url。我的网站是用 PHP 编写的。
在 C# 中,它的工作方式如下:但要提到的主要一点是我将如何在 PH 中执行此操作,因为似乎无法找到关于此的良好文档。提前致谢
public void ProcessRequest (HttpContext context)
{
context.Response.Buffer = true;
string response = "";
string sMethod = "POST";
//sUrl holds the address to the Verify service, this is a service from AllCharge
// that verifies the signature on the notification. This makes sure that the notification
// was sent by AllCharge.
//Demo server - use this address during the integaration, remark this line when working
// with the live server
string sUrl = "http://demo.allcharge.com/Verify/VerifyNotification.aspx";
//Live server - use this address when working with the live server, remark this line
// during the integration
//string sUrl = "https://incharge.allcharge.com/Verify/VerifyNotification.aspx";
Int32 nCount = context.Request.TotalBytes;
string formParameters = System.Text.Encoding.UTF8.GetString(context.Request.BinaryRead(nCount));
}