从一个接口地址,用户名和密码,两个参数(订单号,产品号),查询产品明细数据信息。应该要怎么写语句呀,参照网络上面的,
url:= 'http://aa.aabo.cn:8088/WebService/QRService.asmx/GetHgzForALL",{"account": "user1","password": "user123","data": [{"productCode": "010059252","quantity": "2"}]}'
jsonstr := IdHTTP.Get(url);
是哪边错了呀提示"http/1.1 400 bad request"
url:= 'http://aa.aabo.cn:8088/WebService/QRService.asmx/GetHgzForALL",{"account": "user1","password": "user123","data": [{"productCode": "010059252","quantity": "2"}]}'
jsonstr := IdHTTP.Get(url);
是哪边错了呀提示"http/1.1 400 bad request"
http://blog.csdn.net/cb168/article/details/8817830
sendrecord=record
ord:integer;
num:string;
url:string;
host:string;
refer:string;
useragent:string;
accept:string;
myheader:string;
cookie:string;
postdata:string;
acceptencoding:string;
contenttype:string;
ProxyServer:string;
ProxyPort:integer;
image:tmemorystream;
yzm:string;
tag:string;
end;
var
send:sendrecord;
send.url:='http://aa.aabo.cn:8088/WebService/QRService.asmx/GetHgzForALL';
send.postdata:='{"account": "user1","password": "user123","data": [{"productCode": "010059252","quantity": "2"}]}'';
if (send.postdata='') and (post=false) then gethttp.Get(send.url,response)
else
begin
postd:=tstringstream.Create('');
try
postd.WriteString(send.postdata);
http.Request.ContentLength:=postd.Size;
http.post(send.url,postd,response);
finally
postd.Free;
end;
end;
直接用get应该也可以要改下格式,send.url:=send.url+'&account='+'user1'+'&password='+'user123'+...