Advertisement
Guest User

Untitled

a guest
Mar 14th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3. lJSO : String;
  4. lRequest: TStringStream;
  5. JValue: TJSONValue;
  6. LJsonObj : TJSONObject;
  7.  
  8. begin
  9.  
  10. // These are the parameters for login into the server
  11. // lJSO := '{"email":"admin@ceb.com","password":"admin", "rememberMe" : "true" }';
  12.  
  13. SimpleAuthenticator.Username := 'admin@ceb.com';
  14. SimpleAuthenticator.Password := 'admin';
  15.  
  16. RESTClient.BaseURL := 'http://mobility.interclip.com:8080/mobility-sfe/api/index.xhtml#!/authentication/login';
  17.  
  18. RESTRequest.Params[0].Name := 'email';
  19. RESTRequest.Params[0].Value := 'admin@ceb.com';
  20. RESTRequest.Params[1].Name := 'password';
  21. RESTRequest.Params[1].Value := 'admin';
  22. RESTRequest.Params[2].Name := 'rememberMe';
  23. RESTRequest.Params[2].Value := 'True';
  24. RESTRequest.Execute;
  25.  
  26. // ShowMessage( IntToStr( RESTResponse.StatusCode ) );
  27.  
  28. if assigned(RESTResponse.JSONValue) then
  29. memo1.Lines.Text := TJson.Format(RESTResponse.JSONValue);
  30. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement