-
Content Count
155 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Die Holländer
-
delphibasics.co.uk
-
I took over a Delphi Mormot webserver with source and both Get (root) and Post (rootp) are implemented. GET implementation FModel := TSQLModel.Create([], StringToUTF8(fRoot)); FServer := TSQLRestServerFullMemory.Create(FModel, 'test.json', False, False {true}); FServer.ServicesRouting := TSQLRestRoutingREST2; POST implementation FModel_Post := TSQLModel.Create([], StringToUTF8(fRootPost)); FServer_Post := TSQLRestServerFullMemory.Create(FModel_Post, 'test.json', False, False {true}); FServer_Post.ServicesRouting := TSQLRestRoutingJSON_RPC2; //I can change this (to Rest?) if needed because the POST method is not used yet.. There is a test function Add and is called by the client as: localhost:8181/root/<ApplicationName>/Add?n1=1&n2=5 (with http://) Now I want to use the POST method of the server and test it with a small HTTP client program to call the add function. I have tried a lot of ways but no success.. (Bad Request) For example: PostData := TStringList.Create; try PostData.Add('{"n1":1,"n2":5}'); Param:='http://localhost:8181/rootp/<ApplicationName>.Add'; IdHTTP1.HTTPOptions := IdHTTP1.HTTPOptions + [hoNoProtocolErrorException, hoWantProtocolErrorContent]; IdHTTP1.Request.ContentType := 'application/json'; IdHTTP1.Request.Accept := 'application/json'; IdHTTP1.Request.CacheControl := 'no-cache'; ReceiveData:=IdHTTP1.POST(Param,PostData); Finally PostData.Free; End; What is the proper way to use the POST request ? Thanks.
-
Switch MorMot webserver from Get to Post
Die Holländer replied to Die Holländer's topic in Delphi Third-Party
I've tried that but what I understand is that declaration with the slash is when you create the server with the TSQLRestRoutingREST2 servicerouting instead of TSQLRestRoutingJSON_RPC2. When trying to use parameters the server responds with: { "errorCode":406, "errorText":"sicShared execution failed (probably due to bad input parameters: e.g. did you initialize your input record(s)?) for ScenarioAnalyseTester.Add" } The POST method is working when the server is started with TSQLRestRoutingREST2 and the whole URL string is like the Get method: localhost:8181/root/<ApplicationName>/Add?n1=1&n2=5 and leave the parameters empty but I guess there must be a way to get the result by using the "rootp" server with TSQLRestRoutingJSON_RPC2 and the parameters field of the POST method.. -
If you add the connection by the data explorer you get a wizard that can help you to get the proper parameters for your .ini file Are you sure that the database parameter in your ini must be ";DAtabase = qclocal;" (not sure if it is case sensitive.. DAtabase?)
-
I checked if the CNPack is for any use for my development in Delphi Alexandria 11.3 but after the check I choose not to use it any longer. (It also gave me an error message after the install but everything seems to work ok..) Now I uninstalled the CNPack and when I start Delphi I get the message: "Could not find Wizard, C:\Program Files(x86)\CnPack\CnWizards\CnWizloader.DLL" Does anyone know how to repair this uninstall, so that I can start Delphi again without this error message? Where is this declaration of the DLL stored in Delphi?
-
Uninstall CNPack wizard, now error when start Delphi
Die Holländer replied to Die Holländer's topic in General Help
Yes, Many Thanks ! -
Maybe you can consider to use the CredentialManager of Windows. Stored info is encrypted based on your Windows User login of the machine. It's only readable (by every application) when the user is logged in. It's very easy to read and write to it from Delphi with 2 or 3 functions/procedures.
-
I learned that lesson.. For a long time, since I use Delphi for my company in a business situation I don't take any risk anymore to upgrade or installing a new Delphi version on the same development machine. (read: most of the time uninstalling and installing) Although people telling me that 2 versions of Delphi or upgrading is no problem.. So, I forced my systemmanager to give me a clean machine and I start installing the upgrade or new version from scratch leaving my development machine as it is. This means that I also have to setup the other (helper) software I use but I never had this problem of Delphi not starting anymore.
-
Has this something to do with the Application.MainFormOnTaskbar := True; statement in the .dpr main project file?
-
I just finished a small project using a billing receipt printer (like a Dymo printer but with long paper) with also the possibility to export the output to a PDF file. I have used the HTMLViewer component that has a print capability and in combination with the Synopse PDF exporter it is easy to export the output to PDF because SynPDF is also working with TMeta canvas, like the HTMLViewer. The nice thing is that with the HTMLViewer you can format a nice output using HTML in your Delphi code. Send you HTML string to the canvas of the HTMLViewer and print it. In my case the customer maybe want to get the receipt with email, so I export the output to PDF and attach it to an e-mail. HTMLViewer Synopse SynPDF
-
Nice. 👍
-
First version nice arranged, now overlapping..
-
-
Very nice project. Visually I like the first release the most. OK, some Units appear quite far away from the center in the first release but that seems to fit with the use of them. (more unimportant than the main units in the center) On the last version and the one before every unit is more in the center but also overlapping and making some parts of the screen very messy. The extra Unit dependencies screen is now showing black circles without text and I don't know what they are.
-
curl-example for POST works, Delphi code throws an 404
Die Holländer replied to philipp.hofmann's topic in Network, Cloud and Web
Is it only me wondering why people are using more and more inline variable declarations in Delphi code? with TIdHTTP.Create(nil) do try var FIdSSLIOHandlerSocketOpenSSL:TIdSSLIOHandlerSocketOpenSSL:=TIdSSLIOHandlerSocketOpenSSL.Create(nil); var Params: TIdMultiPartFormDataStream; -
If you want to avoid the Browser Popup.. URLAllowlist.reg Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\URLAllowlist] "1"="myapp://*" [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\URLAllowlist] "1"="myapp://*" [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Exceptions] "1"="myapp://*"
-
Is this a question? Normally a site is written for a web browser, so it doesn't matter if it is for Android, because all the browsers can use it. You can write a web server in Delphi using systems like DataSnap or MorMot. If you mean you want a Android App then you can use Delphi FireMonkey framework (FMX) to create an app for Android. In both cases put your database in a cloud, like Azure and let the website or App connect to it. Delphi FireDac works very nice with cloud databases. Delphi enterprise version with FireDac can easily connect to MS-SQL databases and then you will be also able to use the MS-Database Tools. The MS-SQL Management Studio has now all the Azure tools integrated to connect to the cloud database.
-
Very Nice !! Now I can impress my management even more..
-
Which edition do you own? MSSQL is supported in Enterprise and Architect Editions https://www.embarcadero.com/products/rad-studio/firedac
-
Streams - Writing and Reading data or text from
Die Holländer replied to JohnLM's topic in Algorithms, Data Structures and Class Design
Hi Remy, Your site (Lebeau Software) is not available anymore. Are you planning to continue with the site? -
-
Its also a bit silly to compare a full user-info input screen with a single drop-down or touch button.. 🤪
-
Some components have DelphiVCL4Python-specific implementations to access their attributes. For example, to set header text for our first column here, using the SetCells() method as StringGrid.SetCells(0,0,"To-Do") is the Python equivalent of the Delphi Object Pascal StringGrid.Cells[0,0]:= Str("To-Do"); and the C++ StringGrid->Cells[0][0] = Str("To-Do"); introduction to pyscripter the best free python ide
-
Store a large number of images in the filesystem or in a DB?
Die Holländer replied to RaelB's topic in Databases
MS-SQL database has a special implementation "FileTables" to handle the file-system in combination with the database.