接收数据:
提交数据:
在浏览器的地址栏输入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
namespace
WebApplication1
{
/// <summary>
/// Handler1 的摘要说明
/// </summary>
public
class
Handler1 : IHttpHandler
{
public
void
ProcessRequest(HttpContext context)
{
string
JsonData = context.Request.QueryString[
"Json"
];
context.Response.ContentType =
"text/plain"
;
//context.Response.Write("Hello World");
context.Response.Write(
string
.Format(
"你刚刚提交上来的数据:\n{0}"
, JsonData));
}
public
bool
IsReusable
{
get
{
return
false
;
}
}
}
}
|
提交数据:
在浏览器的地址栏输入
1
|
http:
//localhost:7240/Handler1.ashx?Json={"Name":"Tom","Age":"20"}
|