bcb2010 post例子

记不住啊记不住,indy版本10.5.5

void __fastcall TForm1::btn1Click(TObject *Sender)
{
    TStringList* params = new TStringList;
    params->Add("account=1111");
    params->Add("passwd=2222");

    IdHTTP->HandleRedirects = true;
    IdHTTP->Response->CharSet = "gb2312";
    IdHTTP->Request->UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
    String result = IdHTTP->Post("http://www.baidu.com/",params);

    this->Memo1->Text = result;
}

 

你可能感兴趣的:(post)