begin s := '{"from":"UT"}'; ss := TstringStream.Create(s); idHttp1.Request.ContentType:='application/x-www-form-urlencoded'; s1 := IdHttp1.Post('http://192.168.1.25:9022/api.aspx/getstates',ss);//这句报错,s1也没取得返回值 showmessage(s1); end;
hint : D7,Ansi,XE~,Unicode, so.....ss need coded as ansi Other : change useragent string as IE would avoid some rude sever give you "Connection closed gracefully' why English? Rongwozhuanggebi
----------------------------------------------
-