简体   繁体   English

如何从ajax发布请求的请求字符串中获取参数

[英]how to fetch parameters from request string for ajax post request

I am sending a request by ajax post request, then by asp classic how can I fetch the parameters send by this request 我通过ajax发布请求发送请求,然后通过asp classic发送该请求发送的参数

My code snippet is as below 我的代码段如下

var url = "get_data.asp";
var params = "lorem=ipsum&name=binny";
http.open("POST", url, true);

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = fetch_Data;
http.send(params);

please help me 请帮我

From the perspective of ASP its a POST request like any other, so; 从ASP的角度来看,其POST请求与其他任何请求一样,因此;

x = Request.Form("lorem")
y = Request.Form("name")

http://www.codeguru.com/csharp/.net/net_asp/article.php/c19325/ http://www.codeguru.com/csharp/.net/net_asp/article.php/c19325/

Since this is a POST request, you can treat it as if it were a form submission. 由于这是一个POST请求,因此您可以将其视为表单提交。

For example, if you have a "name" field: 例如,如果您有一个“名称”字段:

myVariable = Request.Form("Name")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM