HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
</head>
<body>
<form id="form1" method="post" action="4-08.aspx">
  <label>
  用户:
  <input type="text" name="user" />
  </label>
  <p>密码:
    <label>
    <input type="password" name="password" />
    </label>
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label> 
   </p>
  <p>&nbsp;</p>
</form>
</body>
</html>
ASP.NET
public partial class _info : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string strName = Request.Form["user"];
        string strPwd = Request.Form["password"];
        Response.Write("user=" +strName);
        Response.Write("<br>");
        Response.Write("password=" +strPwd);
    }
}
请问用IdHttp如何提交数据?

解决方案 »

  1.   

    补充下:
    单纯在一个asp.net里面是可以提交的,但重定向就不行了。
    那位朋友能帮忙指点下,先谢过了!
      

  2.   

    var
      body:string
    begin
    body:=IdHTTP1.Get(geturl);
    end;
    重定向,idhttp1.HandleRedirects:=true;
      

  3.   

    想法:
    通过html传入参数
    <input type="text" name="user" />
    <input type="password" name="password" />
    通过delphi程序post(aURL)参数后,服务器接受的数据重定向返回一个页面4-08.aspx,
    只有两行:
    user=123456
    password=123456这个过程具体该如何做?
      

  4.   

    post的话,也差不多var
      sParams: TStringStream;begin
      PostData := TStringList.Create;
      PostData.Add('id=1');
      Memo1.Lines.Text := idHTTP1.Post('http://www.google.com', PostData);
      PostData.Free;  
    end;
      

  5.   

    提示:“HTTP/1.1 405 Method not allowed”错误Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。还是换一种实现方式吧。