Jump to content

al17nichols

Members
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by al17nichols

  1. 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.
  2. al17nichols

    Using Delphi Rest Components

    Thanks
  3. How can I pass a value as a an https only cookie using the rest components?
  4. 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.
  5. 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.
  6. 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)?
  7. al17nichols

    rest json, RestRequest

    closing here
  8. al17nichols

    rest json, RestRequest

    Uwe Raabe Thanks this will be very helpful.
  9. 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.
  10. 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?
  11. 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'."
  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. What is the best way to flush the buffer on both the indy client tidtcpclient and server tidtcpserver components? Also, is there an acknowledgement when the flush is complete. This includes flushing read and write buffers for both components.
  14. al17nichols

    Best way to store data

    I have some data that will only persist while the server is up and operational. If the server is restarted daily the data is built over time as needed by the currently logged in users. Currently I store the data using somewhat of a linked list. This makes it harder to manage, ie. add, delete, or search for messages for a single user, and is searched in one of 2 possible ways. The question is which is the more efficient way to store this data: FDMemtable, or SQLLite. I would say that at any point in time there might be 20,000 - 30,000 records during a given day.
  15. 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.
  16. 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 ;
  17. 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.
  18. al17nichols

    how to flush buffers on Indy components

    the IOHandler referenced points to the tidtpclient with a designated port. Transferring a file using the filestream. The server sends the filesize a little earlier in a message that is wrapped in XML to include other information prior to the server (tidtcpserver) sending the actual file. The receive does not send any information at the end of the transfer (interesting idea) at the current time. The problem may occur that the transfer gets disrupted for some reason and I want to continue to use the connection by flushing any remaining data. FYI: I read the remainder of your message and see that I need to add a message or something to indicate that the transfer has ended.
  19. al17nichols

    how to flush buffers on Indy components

    Hello Remy. Apologies for the time it has taken to get back to this post. In this case I am doing a file transfer using this approach. IOHandler.ReadStream( XferStream, FileSize ,false ). This actually works most of the time as in (99.9%) of the time. If it fails it is a result of some issue of mine, but if it fails I need to recover the client and server applications.
  20. al17nichols

    how to flush buffers on Indy components

    The desire is not to close the socket, but remove all of the bytes like a resync so that we can start communicating again. The fact that I do not want to close and reopen the socket was not clear, but I do not want to close, but I do want to restart the communication.
  21. al17nichols

    how to flush buffers on Indy components

    Thanks for your reply. A scenario can occur when receiving data that an exception occurs or something happens that disrupts the flow of data. I want to flush the remaining data that is being received so that I can reread the data. I was doing a file transfer and the transfer was disrupted. I read from the socket and there is more data coming from the buffer. I have to close the socket and reopen to resync communication. I hope this makes sense.
  22. I am looking for a sample application that demonstrates replacing a TClientDataset with Firedac application in a 3 tier environment. In the middle layer I need access to new and old values, updatekind, etc. I need access to how the update is applied as exhibited in the tprovider. I need to understand how the client side connects to the middle layer.
  23. al17nichols

    FireDac replacement ClientDataset in 3 tier application

    Actually I have this book. I didn't see anything about multitier applications and replacing clientdatasets.
  24. al17nichols

    FDMemtable with localsql

    Is there a way to determine if localsql is using an index when running a query against an FDMemtable?
  25. al17nichols

    sqlmemtable

    Is sqlmemtable by AidAim Software active and a viable solution. Performance stats indicate that it is a interesting product, but the demos are old and do not appear to run. I can't find youtube videos or any 3rd party literature. If this is not a viable solution what is the best choice for a memory table use in Delphi 11.1 or Delphi Berlin.
×