Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ExampleLoginModule Sample user/password location using Real Thin Client
Mon, Jun 27 2016 1:53 AMPermanent Link

Sidney

The ExampleLoginModule sample uses this code to get the user and password values.  I am trying to accomplish the same thing in RealThinClient but am unable to locate either the full content or the user/password values within the RTC structure for TRtcConnection.  Does anyone know where these values are in RTC?

procedure TExampleLoginModule.EWBModuleExecute(Request: TEWBServerRequest);
...
begin
  with Request do
...
        TempContent:=TStringList.Create;
        try
           TempContent.Text:=UTF8ToWideString(RequestContent);
           TempUserID:=TempContent.Values['user'];
           TempPassword:=TempContent.Values['password'];

Fiddler logged the post request as follows:

POST http://localhost:91/modules/loginmodule HTTP/1.1
Host: localhost:91
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: text/plain
Referer: http://localhost:91/testrtc.html
Content-Length: 35
Connection: keep-alive

User=StanSmith
Password=Frannie911
Mon, Jun 27 2016 3:44 AMPermanent Link

Matthew Jones

Sidney wrote:

>  but am unable to locate either the full content or the user/password
> values

The only help I can offer is that I have often found the answers by
putting a breakpoint at the key part, and then either inspecting the
objects around, or stepping back in the stack to work out other
possible objects, and perhaps adding more breakpoints. That's how I
figured out the RemObjects/Indy code and was able to adapt to my needs.
Mon, Jun 27 2016 6:49 AMPermanent Link

Walter Matte

Tactical Business Corporation

Hi Sidney:

procedure TForm1.RtcDataProvider3DataReceived(Sender: TRtcConnection);
var
 i : integer;
 sl : stringlist;
begin
 with Sender as TRtcDataServer do
 begin
       if (Request.Method='POST') then
       begin
          Request.Params.AddText(Read);
          if (Request.Complete) then
          begin
//            SEE  Request.Params.Text     <<<<<<<<<
      
          sl := TStringList.Create;
          sl.Text := Request.Params.Text;
          for i := 0 to sl.Count-1 do
          Showmessage(sl[i]);
          sl.free;

          end;
       end;
 end;
end;


The test server code I had email you a few days ago can be used to see this - dataprovider3 - dumped any post into memo.

The EWB Client Module just need to URL changed to use that test program.

procedure TMainForm.LoginButtonClick(Sender: TObject);
begin
  with LoginRequest do
     begin
     Method:=rmPost;
     URL:='http://localhost:82' + '/modules/loginmodule';   // <<<<<<<<<
     RequestHeaders.Clear;
     RequestHeaders.Values['Content-Type']:='text/plain';
     RequestContent.Clear;
     RequestContent.Values['User']:=UserIDEdit.Text;
     RequestContent.Values['Password']:=PasswordEdit.Text;
     Execute;
     end;
end;



Walter
Image