Jump to content

al17nichols

Members
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. al17nichols

    Using Delphi Rest Components

    Thanks
  2. How can I pass a value as a an https only cookie using the rest components?
  3. How do I designate a header value. I see the parameter with pkHTTPHeader, but How do I see the actual header prior to posting or issuing a get? Do I add double quotes to ensure it is a string? Thanks in advance.
  4. al17nichols

    Using Rest Components

    Truly thanking you for your help. I had added the parameters, but the parameters do not display when I call restrequest.getfullrequesturl with a post. These parameters and values appear with I issue as a rmGet.
  5. al17nichols

    Using Rest Components

    I did some digging on the rest components an observed that getfullrequesturl never displayed the parameters and values when attempting to see what is actually being passed to the server. Is there a property that changes the post to https instead of http? Lastly when I right clicked the restrequest and selected with test data I did get results that began with "Data":{"AccessToken":"eyJhbGciOiJfolllowed by a long string of token information...."}. Where do I input parameters and parameter values? I tried to retrieve the data using RESTResponse1.GetSimpleValue('Data', LToken) or RESTResponse1.GetSimpleValue('AccessToken', LToken) . Never was able to retrieve the data using this process. If anyone know how to retrieve this data please let me know. FYI there are 4 questions detailed here. Please help.
  6. al17nichols

    rest json, RestRequest

    closing here
  7. al17nichols

    rest json, RestRequest

    Uwe Raabe Thanks this will be very helpful.
  8. I am accessing a web end webservice. Unlike the sample projects that I have seen which download a json file, I need to access the endpoint, grab a token, request other identifiers with the token, finally use the token with other parameters to retrieve JSON data from an endpoint. Would this be accomplished with TRestClient, TRestRequest, TRestResponse components as configured in the example projects or would another approach be taken. If I used the referenced VCL components I would have to use multiple sets of the 3 components or change the parameters to resubmit requests to the endpoint for the different pieces of data. Can somebody advise the best approach to retrieve the desired results. It is acceptable to recommend another approach altogether if it is the best approach.
  9. al17nichols

    rest json, RestRequest

    I managed to solve this by correcting the a few of the properties and now I received the expected results. My remaining question is how do I know that exact statements are sent to the server? Is there a way to know what XML, JSON are we submitting to the endpoint?
  10. al17nichols

    rest json, RestRequest

    I have the parameters you described, but I received response that it does not support method get. I have the mentioned credentials and supplied them as parameters to the trestrequest component with the parameters method property set as rm post. Message "The requested resource does not support http method 'GET'."
  11. al17nichols

    rest json, RestRequest

    I have a url, parameters that I want to sent do an endpoint with the post command and receive a response token. I placed the url in the restclient with the endpoint as https://bbb.domainx.com/v31/api/auth. I added individual parameters. I assigned the method as rmpost ( i tried it as rmget ) in neither case did it work. I receive 404 Not found. Anybody know what I am doing wrong? Also. how can I find the resulting json that is being sent to the website (for trouble shooting purposes)?
  12. al17nichols

    Twilio WebHook

    Has anybody had experience creating a Delphi application that can respond to a Twilio Webhook? Looking to gain any insight as to how I can create a small application that enables me to know when there is a message coming from Twilio. Thanks
  13. al17nichols

    Best way to store data

    everyday the memory data is flushed. Only newly generated data is stored in the memory or db that I want to create.
  14. al17nichols

    how to flush buffers on Indy components

    below is the server send file code and the client receive code. forgive me. This was done before I knew much about indy. Server side send file TmpFileFS : TFileStream ; if FileExists( FilePath+FileName ) then Connection.IOHandler.WriteLn( Format( XMLHead + XMLTail, ['SPS_AttachGetFileRS', 'ResponseType="[1]" MSG="1" Ack="1"', 'SPS_AttachGetFileRS'] )) else Connection.IOHandler.WriteLn( Format( XMLHead + XMLTail, ['SPS_AttachGetFileRS', 'ResponseType="[1]" MSG="1" Ack="0"', 'SPS_AttachGetFileRS'] )) ; if FileExists( FilePath+FileName ) then begin TmpFileFS := TFileStream.Create( FilePath + FileName, fmOpenRead ); Try // AContext.Connection.IOHandler.WriteLn( Format( XMLHead + XMLTail, ['SPS_AttachFileXferRS', 'ResponseType="[1]" MSG="1" ' + 'FileName="' + TmpFile + '"', 'SPS_AttachFileXferRS'] )) ; Connection.IOHandler.Write( TmpFileFS ); // AContext.Connection.IOHandler.WriteLn( Format( XMLHead + XMLTail, ['SPS_AttachFileXferRS', 'ResponseType="[1]" MSG="1" ' + 'Ack="1"', 'SPS_AttachFileXferRS'] )) ; Finally TmpFileFS.Free ; client side receive file /*Plain message sent requesing file by name ;*/ /* XML response received below at readln */ --->MsgResp := frmTuner.CommMsgInt.IOHandler.Readln ; if Length(MsgResp) = 0 then raise Exception.Create('File Not Located'); VarList := TList.Create ; New( XMLVars ) ; XMLVars.VarName := 'SPS_AttachGetFileRS' ; XMLVars.AttNode := xxXMLNode ; XMLVars.VarValue := '' ; VarList.Add( XMLVars ) ; New( XMLVars ) ; XMLVars.VarName := 'Ack' ; XMLVars.AttNode := xxXMLAttrib ; XMLVars.VarValue := '' ; VarList.Add( XMLVars ) ; XMLMsgToTxt( MsgResp, VarList ) ; MsgResp := PXMLInfo( VarList[1]).VarValue ; if MsgResp = '1' then /* if value is 1 the file was located begin /* the filesize and other info was stored in the database */ xFerStream := TFileStream.Create( TempDir + FileName, fmCreate ) ; ---> frmTuner.CommMsgInt.IOHandler.ReadStream( XferStream, FileSize ,false ); XFerStream.Free ;
  15. al17nichols

    Best way to store data

    Only accessed on the server by a threaded process. Multiple connections via socket make be requesting data from the memory or sql lite store. Want to use memory for quick access. If the program crashes or the system is restarted the data needed will be rebuilt from a SQL database.
×