Jump to content

Andrea Magni

Members
  • Content Count

    124
  • Joined

  • Last visited

Community Reputation

47 Excellent

4 Followers

About Andrea Magni

  • Birthday 05/24/1982

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

738 profile views
  1. Andrea Magni

    Heading params list

    I've added a hack (accessing a protected field of TIdHTTPAppRequest casting a reference to TWebRequest to a subclass) that seems (and should reasonably) work. The hack only relates to those deployment methods where Indy is not letting me access the TWebRequestInfo data structure (Apache modules, IIS ISAPI, Windows Service). From now on, you can use the GetHeaderParamCount, GetHeaderParamValue, GetHeaderParamIndex methods of IMARSRequest interface. uses MARS.Core.RequestAndResponse.Interfaces; // in your resource definition or as a method argument [Context] FReq: IMARSRequest; Let me know if this is enough. Feel free to reopen issue #95 if needed. Sincerely, Andrea
  2. Andrea Magni

    Heading params list

    Hi @Claudio Villaschi, sorry for the late. There are some limitations with Indy and enumerating request headers. I am trying to improve the current support as much as possible. Follow this: https://github.com/andrea-magni/MARS/issues/95 Sincerely, Andrea
  3. Hi @bioman, thanks for pointing out compilation broke. I just fixed it: https://github.com/andrea-magni/MARS/issues/94 About the encoding, MARS is a layer of abstraction over the transport protocol (http). You implement your method (I guess) returning a Delphi string value. MARS serializes (where needed) the values to a stream that will be used as the response of the request. Then, it's the underlying http library (MARS supports Indy, WebBroker over Apache module and IIS ISAPI and, more recently, Delphi Cross Socket framework) that sends the content to the client. Indy has this trend of setting Content-Type=text/html; charset=ISO-8859-1 as default so sometimes you get it (when using Indy/WebBroker as http layer for MARS). MARS (and Indy neither) can't easily say if your string is a UTF8 or MBCS or ANSI string, but you should know for sure. So, if you are sending an UTF8 content in your string, mark your resource/method with an Encoding attribute stating so. [GET, Path('geoconding.html'), Encoding('UTF-8')] function MyContentGenerator: string; Let me know if you solve this way! Sincerely, Andrea
  4. Andrea Magni

    MARS & Delphi 10.2

    Thanks, I am using a portion of mORMot (check my mORMotJWT repository: https://github.com/andrea-magni/mORMot-JWT) I have extracted (with permission) in order to benefit of their JWT implementation (that is way better than the JOSE implementation). Unfortunately, they are (were?) not supporting Linux compilation with Delphi because of ARC. That's the reason I still have JOSE and mORMotJWT support at the same time. Glad you solved! Sincerely, Andrea
  5. Hi @NilsSchneider, would you please post here the resource definition? If I got it correctly you registered three different resource classes for the same path (systems). Sincerely, Andrea
  6. @bioman, hi, thanks for the kind words about MARS! Would you please paste here the prototype of your method? What data type the result is? Sincerely, Andrea
  7. We are fine thanks! Getting used to the "new normal" and looking ahead hoping things will globally improve soon. I've merged your PR a couple of minutes ago, thanks! 🙂 Andrea
  8. Hi @Stuart Clennett, my fault! I forgot to update some prototypes here and there. Thanks for pointing this out: add these to the uses clause: , MARS.Core.URL, MARS.Core.RequestAndResponse.Interfaces change the BeforeHandleRequest assignment to : FEngine.BeforeHandleRequest := function (const AEngine: TMARSEngine; const AURL: TMARSURL; const ARequest: IMARSRequest; const AResponse: IMARSResponse; var Handled: Boolean ): Boolean begin Thanks! I'll fixit in the repo ASAP Andrea
  9. Right, thanks @ertank! In the Source/MARS.inc file there is a specific define to state FireDAC support is included or not: https://github.com/andrea-magni/MARS/blob/edb3c7e7a43dbac2f94f124b08107a6c3f4b5074/Source/MARS.inc#L1 Sincerely, Andrea
  10. Just in case you missed: a new version of MARS-Curiosity REST library has been released yesterday. https://github.com/andrea-magni/MARS/releases/tag/v1.4 V.1.4 adds support for Delphi 10.4 Sydney as long as many other features and functionalities to the library. I will cover most important new features with some blog posts in the following weeks. Sincerely, Andrea
  11. Andrea Magni

    Injection Respose

    Hi Marzio, TMARSResponse is intended to be used as return type of your REST methods. If you are looking for a reference to the response object (implemented by the http layer) the second writing is correct. Soon, I'll release a new MARS version and there will be an IMARSResponse interface, wrapping the underlying object (MARS will be soon able to abstract from the http layer, in order to allow use of DelphiCrossSockect along side of Indy and other libraries). Sincerely, Andrea
  12. Glad you solved, sorry being away so much 😉
  13. Andrea Magni

    GZip compression in MARS

    Hi, sorry for the late (!). I accepted the pull request yesterday. Will be soon available also in the master branch (I am switching to trunk based development model). Sincerely, Andrea
  14. Hi, sorry for the late, I am trying to catch up with all messages here and on github.com. I saw the issue (81) and yesterday I made some work on the develop branch (rebasing it onto master). I attached files with your corrections to the issue, please file a pull request and I will be happy to accept it (and you will show up as a contributor as well). Thanks
  15. I would but, unfortunately, I am lacking time and trying to spend as much time as possible adding new features (i.e. the new Devart UniDAC intregration and the Delphi-Cross-Socket support). Please ask if you need specific help. Sincerely, Andrea
×