function TfrmEBook.ReBooking:Boolean;
var
//ReadTimeout,ConnectTimeout : integer ;
// ConnectTimeout: integer;
FIdhttp : TIdHTTP;
RStream : TStringStream;
strUrl,strStampDate,strDate : string;
strJSonData : widestring;
Digest: TSHA1Digest;
strBookingSHA1:AnsiString;
begin
Result := False;
strBookingSHA1 := '';
strDate :=FormatDateTime('YYYY-MM-dd hh:nn:ss',strStatusDate);
strStampDate :=FormatDateTime('YYYY-MM-dd hh:nn:ss',Now());
strBookingSHA1 :='companyid='+strCompanyId+'&pageindex='+inttostr(CurrentPage)+'×tamp='+strStampDate+'&updatetime='+strDate+'||'+strPlanKeyid;
HashString(AnsiToUtf8(strBookingSHA1),Digest);
strBookingSHA1 := BytesToBase64(Digest);
strBooking:='companyid='+HTTPEncode(strCompanyId)+'&pageindex='+inttostr(CurrentPage)+'×tamp='+HTTPEncode(strStampDate)+'&updatetime='+HTTPEncode(strDate)+'&hash='+HTTPEncode(strBookingSHA1);
RStream := TStringStream.create('');
FIdhttp := TIdHTTP.Create(nil);
strUrl :='http://apis.yundangnet.com/api/v1/sea-order?'+strBooking;
strJSonData := '';
try
//FIdhttp.ConnectTimeout:= 3000;
//FIdhttp.ReadTimeout := 6000 ;
FIdhttp.Get(strUrl,RStream);
strJSonData := widestring(UTF8Decode(RStream.DataString));
finally
FIdhttp.Disconnect;
RStream.Free;
FreeAndNil(FIdhttp);
end;
出现的报错是:invalid argument to date encode~
黄色为报错的点