用idhttp post 方法发送数据到服务器上。实现数据和网页的交互。
2011-06-16 18:57
776 查看
<form action='http://www.blabla.com/login.php' method=POST> <input type='text' name='nick' id='insert_feld1'></td> <input type='password' name='passwort' id='insert_feld1'></td> <input type='submit' value='Login' id='insert_feld1'></td> |
Soweit bin ich mit Hilfe der anderen artikel schon gekommen:
var
IdHTTP: TIdHTTP;
PostDataStream : TStringStream;
ParamData : TStringStream;
begin
IdHTTP:= TIdHTTP.Create(nil);
PostDataStream := TStringStream.Create('');
ParamData := TStringStream.Create('');
ParamData.WriteString('nick=name&passwort=pass');
IdHTTP.Post('http://www.blabla.com/login.php' , ParamData, PostDataStream);
postdatastream.Position:=0;
memo1.Text:=postdatastream.DataString;
end;
aber es funktioniert trozdem nicht. Der Fehler muss irgend wo bei den
übergebenen Daten liegen, weil als Antwort eine vernünftige HTML seite
kommt, nur eben das er mir sagt das pass und username nicht zusammen stimmen.
=====================================
response := TStringList.create;
POSTData := TStringList.create;
POSTData.text := 'add=1&cmd=_cart&business="msc921@hotmail.com"&item_number=1&...etc etc etc';
HTTP1.Post('http://www.paypal.com/cgi-bin/webscr' ,POSTData.text, response);
相关文章推荐
- 向指定 URL 发送GET,POST方法的请求(传入指定url和参数,服务器返回字符串数据)
- 【jQuery】使用post()方法以POST方式从服务器发送数据
- 使用post()方法以POST方式从服务器发送数据
- 初涉Ajax,以post或get方法发送数据,以json或xml形式接收服务器返回的请求
- C++使用POST方法向网页提交数据-----C++发送HTTP数据获取Google天气预报
- jQuery的ajax()检验用户名;通过jQuery的load()/get()/post()方法实现;使用XMLHTTPRequest对象来进行AJAX的异步数据交互
- java实现http post方法发送数据
- C#中在WebClient中使用post发送数据实现方法
- C#中在WebClient中使用post发送数据实现方法
- C#中在WebClient中使用post发送数据实现方法
- java用post方法获取json数据,与服务器进行交互
- 使用post()方法以POST方式从服务器发送数据
- java实现http post方法发送数据
- C# Winform利用POST传值方式模拟表单提交数据(Winform与网页交互)
- 通过POST向WEB服务器发送数据/上传文件(HttpSendRequestEx、InternetWriteFile)
- C# Winform利用POST传值方式模拟表单提交数据(Winform与网页交互)
- libcurl HTTP POST请求向服务器发送json数据
- 纯vc sdk实现http post 方式上传数据到web服务器
- PHP的CURL方法curl_setopt()函数案例介绍(抓取网页,POST数据)
- 使用httppost 实现高效的数据交互接口