idHTTP 向網站發送json格式數據javascript
var rbody:tstringstream; begin rbody:=tstringstream.Create('{"name":"lina"}') ; IdHTTP1.Request.Accept := 'text/javascript'; IdHTTP1.Request.ContentType := 'application/json'; IdHTTP1.Request.ContentEncoding := 'utf-8'; memo1.Text:=idhttp1.Post('http://127.0.0.1/idhttpjson.php', RBody); end;
發送普通格式php
var Param:TStringList; begin Param:=TStringList.Create; Param.Add('name=lina'); memo1.Text:=IdHTTP1.Post('Http://127.0.0.1/idhttpjson.php', Param); end;
https://bbs.csdn.net/topics/390551578java