使用TRESTClient的应用程序挂在新机器上

时间:2018-04-11 21:26:53

标签: delphi

我使用TRESTClientTRESTRequest制作了一个小型测试应用程序。在开发机器上(安装了Delphi)一切正常。如果我在另一台机器上移动exe,则在按下按钮后应用程序挂起。我必须使用这个简单的应用程序部署哪些DLL文件? 这是代码:

procedure TForm44.Button1Click(Sender: TObject);
var
  LClient: TRESTClient;
  LRequest: TRESTRequest;
begin
  LClient := TRESTClient.Create('https://secure.authorize.net/');
  LClient.FallbackCharsetEncoding := '';
  LRequest := TRESTRequest.Create(nil);
  try
    LRequest.Client := LClient;
    LRequest.Method := TRESTRequestMethod.rmPOST;
    LRequest.Resource := 'gateway/transact.dll';
    // merchant info
    LRequest.AddParameter('x_login', 'test', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_tran_key', 'test1', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_version', '3.1', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_test_request', 'TRUE', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_method', 'CC', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_type', 'AUTH_CAPTURE', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_amount', '10', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_delim_data', 'TRUE', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_relay_response', 'FALSE', TRESTRequestParameterKind.pkGETorPOST);
    LRequest.AddParameter('x_description', 'Delphi_Transaction', TRESTRequestParameterKind.pkGETorPOST);

    LRequest.Execute;
    memo1.Lines.Text := LRequest.Response.Content;

  finally
    LClient.Free;
    LRequest.Free;
  end;
end;

0 个答案:

没有答案