【发布时间】:2015-12-23 15:29:17
【问题描述】:
这是我的查询字符串:
http://statement.dana-insurance.com/api/insurance?input=<Statement><GroupId>aseman</GroupId><Password>As1234</Password><StatementNo>87841</StatementNo><StatementSerial>92/1/n</StatementSerial><StatementType>MINIBUS-SEDAN</StatementType><DriverSmartCard1>3146339</DriverSmartCard1><DriverSmartCard2>0</DriverSmartCard2><DriverSmartCard3>0</DriverSmartCard3> <NavySmartCard>1776166</NavySmartCard><TotalRentalPrice>320000</TotalRentalPrice><CityDistance>140</CityDistance><BodyInsurancePrice>0</BodyInsurancePrice><AboardInsurancePrice>1400</AboardInsurancePrice><OriginCode>31380000</OriginCode><DestinationCode>31310000</DestinationCode><MoveDate>1394/10/09</MoveDate> <MoveTime>18:31</MoveTime><PassengerCount>4</PassengerCount><ChairCount>4</ChairCount><NavyType>SEDAN</NavyType><CompanyCode>31523</CompanyCode><PlaqueNumber>575n19</PlaqueNumber><PlaqueSerial>12</PlaqueSerial><ValidateTime>1</ValidateTime><IsTtwicePaid>0</IsTtwicePaid><CarType>NORMAL</CarType><Type>INSERT</Type></Statement>
在浏览器中可以,但是在delphi 7的http.get()中不行,错误是:
server error http/1.1 400 bad request ( the date is invalid )
注意:当我更改我的ISP 并连接到另一个互联网连接时,它工作正常。
这是我的代码:
http:=TIdHTTP.Create(nil);
HTTP.AllowCookies:=true;
http.HandleRedirects := true;
http.ReadTimeout := 45000;
param:=TStringList.create;
Strings := TStringList.Create;
http.Request.ContentType := 'text/xml';
http.Request.Accept := 'text/xml, */*';
http.ReadTimeout:= 100000;
Memo1.Lines.Add(Req_String);
try
dana_str:=http.get(Req_String);
......
【问题讨论】:
-
感谢编辑。迦勒。
-
请显示一些代码。
-
日期是正确的波斯(shamsi)日期。
-
尝试对 URL 进行 URL 编码,至少在
?之后的部分 -
当我使用 urlencode 时,错误是:服务器错误...找不到路径。
proxy setting上的isp生效了吗?如何检查它。在某些isp中,这项工作是正确的,但在其他一些则不起作用。