agarwal_achhnera
agarwal_achhnera

Reputation: 2456

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

Upvotes: 1

Views: 678

Answers (2)

cdeszaq
cdeszaq

Reputation: 31280

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")

Upvotes: 0

Alex K.
Alex K.

Reputation: 175766

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/

Upvotes: 1

Related Questions