Below is the server push notification of results request:
Ashx file code is as follows (think of first receives the request, print to save text, has deployed to the cloud server, test request prompt a 500 error, depressed... ) :
Using Newtonsoft. Json;
Using Newtonsoft. Json. Linq;
using System;
using System.Collections.Generic;
Using System. Collections. Specialized;
using System.IO;
Using System. Linq;
using System.Text;
Using System. The Web;
The namespace Voice_Report
{
///& lt; summary>
///Handler summary description
///& lt;/summary>
Public class Handler: IHttpHandler
{
Public void the ProcessRequest (HttpContext context)
{
NameValueCollection myHeader=new NameValueCollection ();
int i;
String strKey;
The string result;
MyHeader=context. Request. Headers;
Int total=myHeader. Count;
String strResult="";
//get the value of the parameter in the header
For (I=1; i
StrKey=myHeader. GetKey (I);
If (strKey=="number")
{
StrResult +=myHeader. Get (strKey);
}
If (strKey=="state")
{
StrResult +=myHeader. Get (strKey) + "\ r \ n";
}
}
//get request body value
The Stream resStream=HttpContext. Current.. Request InputStream;
StreamReader sr=new StreamReader (resStream, System. Text. The Encoding. The Default).
String requestXml=sr. ReadToEnd ();
Result=strResult;
//write TXT file
String FullFileName=@ "D: \ log_20200115 TXT";
StreamWriter sw=new StreamWriter (FullFileName, true, Encoding. The Default).
Sw. Write (" test ");
//sw. Write (result. The ToString ());
Sw. Write (" \ r \ n "+" Write complete ");
Sw. The Close ();
}
Public bool IsReusable
{
The get
{
return false;
}
}
}
}