Jump to content

Search the Community

Showing results for tags 'rest'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
  • Delphi General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Delphi Third-Party
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Found 7 results

  1. Hi all Delphier , good morning 😀😀 i have rest firemonkey app ,server , client im trying to check if the server is up or down from the client side using the code below , the code work fine , but when i run it its freeze the app for a while is there any proper way to do this ,thank you ,🤓☺️ try RequestLogin.Execute; if FrmLogin.RequestLogin.Response.Status.Success then begin showmessage ('server up') do something ..... end else except on e : exception do begin showmessage (' server down.... go home ') end end;
  2. How to send files to an API using TSslHttpRest? In Postman I can, this is the http code: POST /api/br-invoice-integration/v1/batches HTTP/1.1 Host: qed.onvio.com.br Accept: application/json Authorization: Bearer 42dc0b99-2d17-4898-9c85-0b52ae364c63Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file[]"; filename="/C:/MyFile.xml" Content-Type: text/xml (data) ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="query" {"boxe/File":true} ----WebKitFormBoundary7MA4YWxkTrZu0gW With SslHttpRest, I'm trying to SendStream, like that (similar to the sample OverbyteIcsHttpPost1): FileName := 'C:\MyFile.xml'; RandBoundary := '-----------------------------' + IntToHex(Random(MaxInt), 8) + IntToHex(Random(MaxInt), 8); SslHttpRest1.ContentTypePost := 'multipart/form-data; boundary=' + RandBoundary; Header := RandBoundary + #13#10 + 'Content-Disposition: form-data; name="file[]"; filename="' + 'MyFile.xml' + '"' + #13#10 + 'Content-Type: text/xml' + #13#10 + #13#10; Footer := RandBoundary + #13#10 + 'Content-Disposition: form-data; name="query"' + #13#10 + #13#10 + '{"boxe/File":true}' + #13#10 + RandBoundary + #13#10; SslHttpRest1.SendStream := TMultiPartFileReader.Create(Filename, Header, Footer); SslHttpRest1.SendStream.Position := 0; SslHttpRest1.RestRequest(httpPOST, Myurl); But it doesn't work, just get error: Request completed: 500 Request done, StatusCode #500 {"error":{"code":500,"errors":[],"message":"HTTP 400 Bad Request"}} Has anyone ever needed to do something similar, would this be the way? If anyone can help, I appreciate it.
  3. Hello, I have orders and orderdetails tables. There is one method that should be returning several orders when used. I would like to return a json string to such requests as in following example { "orders":[ { "id":1234, "date":"2020-05-29", "details":[ { "item":"1", "amount":3 }, { "item":"5", "amount":2 }, { "item":"116", "amount":1.3 } ] } ] } I know that I can define method to return a TJsonObject and build json piece by piece in method code. However, I would like to avoid that, if possible. I wonder if there is/are some other ways of doing so in MARS. Thanks & regards, Ertan
  4. Wij zijn op zoek naar een nieuwe aanwinst voor ons ontwikkel team in Oosterwolde. Syntri ontwikkelt een ERP systeem voor de maakindustrie, waarbij proces en workflow centraal staan. - Delphi 10.3 Rio VCL - iOS en Android ontwikkeling in Firemonkey - REST Api Vacature Software Ontwikkelaar
  5. Frédéric

    TDSRestConnection, bug in DoSetCredential

    Hi, Just want to share this and to eventually have confirmation (or not !!) I suspect a bug in the DoSetCredential method used by TDSRestConnection (System.Net.HttpClient.Win, TWinHTTPClient.DoSetCredential) I'm just upgrading an (working !) application from Delphi XE7 to Delphi 10.3.1. It's an application using Datasnap REST to communicate with a standalone Datasnap server (or IIS ISAPI in production) By doing my first tests I immediatly encountered the following problem: By calling the TDSRestConnection.TestConnection I get this error: Error adding header (87): Incorrect parameter ==> ('Paramètre incorrect' translated from french) Basic authentication is used. After debugging the code I saw that TNetEncoding.Base64.Encode adds a linebreak after 76 chars (The base64 encoded credentials goes slightly over 80chars...). This seems the default behavior the TBase64Encoding class but the WinHttpAddRequestHeaders API don't like it. I have changed the code in System.Net.HttpClient.Win to change the CharsPerLine to 255 and then it is OK. Bug or misuse ? Thanks ! Frederic
  6. Davide Visconti

    Web dashboard application

    Hi, I state that I have no skills on the argument, so bear with me. I have read a lot since last week but the argument is really a jungle and I'd like to read your very useful suggestions. I try to explain what we have to do. At the moment we have a win32 application developed in VCL Delphi Tokyo. This app read/write on localhost Firebird DB. Now, we have to realize a web application, like a dashboard , wich the users can utilize to see some values, some charts, execute some predefined queries and change some parameters on DB, the VCL app get some notifications when this happened (event alert) to update the in memory parameters. This web app should run on computer and android mobile too, like this forum 🙂 The number of clients connected are very few, maximum 5. Now, according to you, what library, framework, we have to use for the front-end...? For the back end? I have to use a REST service like @Andrea Magni's MARS Curiosity? Finally, can you give me some guide or how-to that you've found useful to begin please? THANKS A LOT for any suggestions.
  7. It is just a small addition to MARS Client library capabilities but TMARSClientResourceJSON now implements REST.Client.IRESTResponseJSON interface (from Delphi's REST Client library). This basically means you can use a TMARSClientResourceJSON and materialize a dataset through the TRESTResponseDataSetAdapter component (from Delphi's REST Client library). Enjoy 😉