简体   繁体   中英

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

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;

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

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.

For example, if you have a "name" field:

myVariable = Request.Form("Name")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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