标题:IDHTTP get 提交数据失败
只看楼主
kanrensan
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-8-1
 问题点数:0 回复次数:0 
IDHTTP get 提交数据失败
http://lxdq.张三&Phone=18871216316&Address=张三丰路&Appointment=1224834931&Remark%20=送支架&ItemList=[{"Item":"海信电视","Qty":"2","ItemType":"2","Distribution":"1","Installation":"30"}]
    utf-8码,在IE中测试,提交数据成功,但是在delphi中提交数据失败,急求大侠赐教!代码如下:
var
  HttpClient: TIdHttp;
  ParamList: TStringList;
  SS: TStringStream;
  s: string;
begin
  SS := TStringStream.Create;
  s:= Edit13.text + 'OrderNum' +  '=' +  Edit1.Text +  '&'
  + 'Datetime' +  '=' +  Edit2.Text +  '&'
  + 'Customer' +  '=' +  Edit3.Text +  '&'
  + 'Phone' +  '=' +  Edit4.Text +  '&'
  + 'Address' +  '=' +  Edit5.Text +  '&'
  + 'Appointment' +  '=' +  Edit6.Text +  '&'
  + 'Remark ' +  '=' +  Edit7.Text +  '&'
  + 'ItemList=' + '['
  +'{'+
      Chr(34) + 'Item' + Chr(34) + ':' + Chr(34) + Edit8.Text + Chr(34) + ','+
      Chr(34) + 'Qty' + Chr(34) + ':' + Chr(34) + Edit9.Text + Chr(34) + ','+
      Chr(34) + 'ItemType' + Chr(34) + ':' + Chr(34) + Edit10.Text + Chr(34) + ','+
      Chr(34) + 'Distribution' + Chr(34) + ':' + Chr(34) + Edit11.Text + Chr(34) + ','+
      Chr(34) + 'Installation' + Chr(34) + ':' + Chr(34) + Edit12.Text + Chr(34) +
      '}'+
       ']';
    IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
    IdHTTP1.Request.CharSet := 'utf-8';
    IdHTTP1.Request.ContentEncoding := 'utf-8';
    IdHTTP1.GET(s, SS);
    ShowMessage(SS.DataString);
搜索更多相关主题的帖子: 张三丰 Phone 
2016-08-01 16:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467421-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.453598 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved