Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


p-samuel last won the day on November 12 2022

p-samuel had the most liked content!

Community Reputation

2 Neutral

Recent Profile Visitors

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

  1. Sharing similar pangs. Never has been a time which I could compile targeting Android with Delphi that I wouldn't have issues. C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidNDK-21-21.0.40680.4203\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.exe: error: c:\program files (x86)\embarcadero\studio\21.0\lib\Android64\Release\System.o: incompatible target
  2. p-samuel

    Parse Json again, complicated

    Do you know about https://jsontodelphi.com/ website? If you are in a hurry then go there generate your classes dto's. Copy and past your json string and they will generate a dto boilerplate for you. The only problem is that this boilerplate uses generics and cannot be implemented in old versions of Delphi. Otherwise, check out Super Object in github project that is aimed for these cases.
  3. @Remy Lebeau, debugging is quite simple using chrome's dev tools. As you have said before, it seems a better option using TIdEventStream as the data itself is transmitted by events, like a websocket. It's a plug and play. I didn't know Indy was so easy to setup this. type TNotityProviderIndy = class private FIOHandlerSSL: TIdSSLIOHandlerSocketOpenSSL; FIdHTTP: TIdHTTP; FIdEventStream: TIdEventStream; procedure OnWriteEvent(const ABuffer: TIdBytes; AOffset, ACount: Longint; var VResult: Longint); public constructor Create; end; implementation { TNotityProviderIndy } constructor TNotityProviderIndy.Create; begin FIdHTTP := TIdHTTP.Create(nil); FIOHandlerSSL := TIdSSLIOHandlerSocketOpenSSL.Create; FIdEventStream := TIdEventStream.Create; FIOHandlerSSL.SSLOptions.Method := sslvTLSv1_2; FIdHTTP.IOHandler := FIOHandlerSSL; FIdHTTP.Request.Accept := 'text/event-stream'; FIdHTTP.Request.CacheControl := 'no-store'; FIdHTTP.HTTPOptions := [hoNoReadMultipartMIME, hoNoReadChunked]; FIdEventStream.OnWrite := OnWriteEvent; end; procedure TNotityProviderIndy.OnWriteEvent(const ABuffer: TIdBytes; AOffset, ACount: Longint; var VResult: Longint); begin Writeln(IndyTextEncoding_UTF8.GetString(ABuffer)); end; Thanks for the info!
  4. @Remy Lebeau, I don't know any other way of debugging subsequent requests and displaying verbose information apart from using -v in curl so far. @Vincent Gsell's answer helped me on giving me a north where should I go, but I'll also try taking a deep look on the information that you shared. I really appreciate the help of you all. Delphi is a quite hard language and documentation concerning these components is quite hard to find. Thank you all guys!
  5. @Remy Lebeau Here is a snapshot of the response in verbose. I just omitted some sensitive information.
  6. @Vincent Gsell This worked perfectly! I just needed to make some adjustments but it worked just like a glove! Thanks by heart!
  7. Hello @Fr0sT.Brutalthanks for your interest. This is not a websocket, it's a http url. I am trying to read the stream of responses when I send a GET request, but I'm afraid this is not possible to be done in Delphi by native components such as RestResquest or Indy: In Python would sound like this: resp = requests.get("https://ntfy.sh/something-very-strange/json", stream=True) for line in resp.iter_lines(): if line: print(line)
  8. I have an url where I can listen to incoming streams whenever a new notification is published. It works perfectly using the cmd curl command but I can't reproduce the same in delphi. I tried using CreateProcess and read the output stream of the process but was worthless. Some has any idea how to make this? curl -s ntfy.sh/something-very-strange/json Each line is a response from the server. When a "GET" request is sent it opens a connection pool and doesn't closes it, sending packages streams to the subscriber, just like a web-socket, until the subscriber ends the process. My goal is to be able to connect and subscribe to this url through delphi, maybe using some component, process or any other tool which allows me to do so.