「応答は、アプリケーションの URL に直接ポストされます。ポストされると、アプリケーションはその情報からステータス コードとメッセージ ID を取得して、SMS 配信の結果を判断する必要があります。」
基本的に、API に http リクエストを送信してテキスト メッセージを送信すると、その Web サイトはさらに、指定した別の URL に配信ステータスを送信します。今、http を使用してアプリケーションに送信されたデータを受信したいのですが、どうすれば asp.net でそれを行うことができますか?
編集部分
NameValueCollection pColl = Request.Params;
// Iterate through the collection and add
// each key to the string variable.
for (int i = 0; i <= pColl.Count - 1; i++)
{
paramInfo += "Key: " + pColl.GetKey(i) + "<br />";
// Create a string array that contains
// the values associated with each key.
string[]pValues = pColl.GetValues(i);
// Iterate through the array and add
// each value to the string variable.
for (int j = 0; j <= pValues.Length - 1; j++)
{
paramInfo += "Value:" + pValues[j] + "<br /><br />";
}
}
Log(add, paramInfo);
上記のコードは、次の応答を生成します。
Key: result<br />Value:-5<br /><br />Key: transactionid<br />Value:2a8b0559d2a6d96ff2250c5339356293<br /><br />Key: notification<br />Value:msgresult<br /><br />Key: messageid<br />Value:My test message.<br /><br />Key: botkey<br />Value:123456<br /><br />Key: ALL_HTTP<br />Value:HTTP_CONNECTION:keep-alive
HTTP_CONTENT_LENGTH:120
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_ACCEPT:text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
HTTP_HOST:abcdef
HTTP_USER_AGENT:Java/1.6.0_21
HTTP_TRANSACTIONID:2a8b0559d2a6d96ff2250c5339356293
HTTP_MESSAGEID:95a8e9c37b9e449fe47e7d3acdd6f6e5
br /><br />Key: ALL_RAW<br />
Key の値が -5 の結果の場合、応答全体から必要なもの