Jump to content
Alex_mex

Error with first request only

Recommended Posts

Hi everybody, I have a strange error:

 

1. First I'm connecting to RAD Server and do login (TEMSProvider and TBackendAuth):

 

  EMSProvider1.UserName := Edit1.Text;
  EMSProvider1.Password := Edit2.Text;
  BackendAuth1.UserName := Edit1.Text;
  BackendAuth1.Password := Edit2.Text;
  try
    BackendAuth1.Login;
    Memo1.Lines.Add('Logged in');
  except
    on E: Exception do Memo1.Lines.Add(E.message);
  end;

 

Login always is successfull

 

2. Then I'm trying to do request using TBackendEndpoint

 

    try
      RecentStudiesEP.ClearBody;
      RecentStudiesEP.Params.Clear;

      RecentStudiesEP.Resource := 'Studies';

      RecentStudiesEP.ResourceSuffix := DateToIso8601(Now,TRUE);

      RecentStudiesEP.Params.AddItem('DoctorID','455BAC0D-87B3-4D2B-9740-E0B46C65BA82');
      RecentStudiesEP.Execute;
      {Do something}
    except
      on E : exception do
             begin
               Memo1.Lines.Add(e.Message);
             end;
    end;

 

On the first request I'm always getting an error: EMS Error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-str

 

But after that everythig starts to work fine without any errors, the same request does not give any problem and I can use it whenever I want and without any error

 

What it can be? Where is an error? And how to fix it?

 

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×