Jump to content

mvanrijnen

Members
  • Content Count

    494
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mvanrijnen

  1. mvanrijnen

    Can not install Delphi Community Edition 11.2

    How do you get the CE version of 12 ? Delphi IDE for Native Apps: Community Edition - Embarcadero States its still 11.x ?
  2. mvanrijnen

    Delphi CE application accesses unknown IPs

    Ah see, little bit strange that a site as virustotal does not take this to consideration or report it with the found ip's.
  3. In D11.3, with search (ctrl-f and/or ctrl-shift-f), the checkbox for "Whole words only", goes randomly to checked state in my IDE. Somebody who knows why this is, and/or how to fix this ? (i want it not checked by default)
  4. mvanrijnen

    Delphi CE application accesses unknown IPs

    You can check this also with procmon: Process Monitor - Sysinternals | Microsoft Learn as said, i'm gonna check this now 🙂 (private laptop i have CE installed, will do the same tomorrow with the Enterprise edition). procmon does not detect any network connectivity simple console app: (and just for fun i attached the ip trace from procmon, running bds-> start project1 -> close bds) Virustotal result: Link: VirusTotal - File - 956317d6f12af53a4c97db41807e9dd51fd37c30057607cecb969fc9214ccb99 Scanning: Bkav Pro W32.AIDetectMalware RisingTrojan.Generic@AI.100 (RDML:gihstO5MCnK0eVlOewg5Rw) SecureAgeMalicious VBA32 TScope.Trojan.Delf IP Traffic When executing the file being studied, it generated the following IP traffic. 192.229.211.108:80 (TCP) 20.99.184.37:443 (TCP) program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; begin try try Writeln; Writeln('This is just a test'); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally Writeln; Write('press enter...'); Readln; end; end. bds ip trace.txt
  5. i'm out of idea, very strange that you get a statuscode 200, visible content in the proxy but not content in the delphi object.
  6. mvanrijnen

    Spring4D dictionary and record values

    litlle bit offtopic, just curious, but what would be the (big) advantage of using Spring4D for collections instead of the "Built In" generics/collections from Delphi?,.
  7. but there is clearly JSON data in the response, i really would not know where your response content is empty
  8. ah ok. You can see that there is content (348 bytes) but i think i know the problem, probably your accept header is not ok. more will follow in a minute, i check something..... you have this RESTProfileRequest.Params.AddItem('Accept', '*/*', TRESTRequestParameterKind.pkHTTPHEADER); somewhere? change the '*/* in 'application/json' or better just use the constant: CONTENTTYPE_APPLICATION_JSON (is declared in the Rest.Types unit) i use: req.AddParameter('Accept', ctAPPLICATION_JSON, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]);
  9. mvanrijnen

    Delphi 12 is available

    could be that we had the same problem, therefore we only use the pure/clear $(Auto)
  10. mvanrijnen

    Delphi 12 is available

    Just set it to auto in de Project options for the package: Lib suffix: $(Auto)
  11. mvanrijnen

    Delphi 12 is available

    Yes, they should turn it around, first release the CE as a preview,, get the community to work for you, they will if you provide them a free IDE. Go more to a system as MS does, you need to have a payed license if you have $xxx in annual revenue.......
  12. mvanrijnen

    Delphi 12 is available

    hmz, have to take a look at that if we upgrade to D12
  13. mvanrijnen

    Delphi 12 is available

    I think they should also change the BDSCatalogRepository BDSCatalogRepositoryAllUsers paths, by default they do not have a version in it (at least untill 11.3), i always change these to something like "D:\Data\Delphi\Catalog\22" (and then the same value for BDSCatalogRepository as for BDSCatalogRepositoryAllUsers)
  14. mvanrijnen

    Delphi 12 is available

    but is i read it correctly how to solve this, it's just plain old DLL hell, not so difficult to solve ....
  15. mvanrijnen

    Delphi 12 is available

    Maybe the problem is that the Beta testing is done on "clean" systems only ?
  16. Very strange, if you get a response code of 200 and you see the body in the proxy it should have a value, can you see if request.Response.Content contains any text? (debug it right after request.execute in your code)
  17. so you do get a response now, try now without the Async, i think problem might be in the Async method now. (not in the method, but how you handle it). I never used that method, i believe you have to have an event catching the response or something like that ? (can check that tomorrow, i now go to bed : )
  18. mvanrijnen

    Delphi 12 is available

    When will the CE release will be released? (i have the CE version on my private laptop)
  19. mvanrijnen

    trying to POST multiple values of same parameter

    Don ;t think thats possible with the Params property, it all ends up merging the diffentt params from client/request etc, and there they get overwritten when having the same name. You have to fill your request body by hand then i think.
  20. mvanrijnen

    trying to POST multiple values of same parameter

    Best way is to use a proxy, for a list see for example: mitmproxy Alternatives: Top 10 HTTP(S) & Web Debuggers | AlternativeTo ( i use mitm and/or fiddler, charles is also mentioned by @Uwe Raabe i believe) let mee see if i can capture some output for this. Here it works like a charm..... var ...... prm : TRESTRequestParameter; begin ..... req := TRESTRequest.Create(nil); try req.Client := FRestClient; req.Method := TRESTRequestMethod.rmPost; req.Resource := cExtensionResource; ..... prm := req.Params.AddItem(); prm.Name := 'testmultivalue'; prm.AddValue('Value_1'); prm.AddValue('Value_2'); prm.AddValue('Value_3'); prm.AddValue('Value_A'); req.Execute(); ..... don't mind the 400 error, i just changed a get into a post to try.
  21. mvanrijnen

    trying to POST multiple values of same parameter

    Which Delphi version? In 11.3 there are a couple of overloads, but not that "overload version"? found it 🙂 overread the parameterless in your post that in combination with the .AddValue would be the solution
  22. mvanrijnen

    trying to POST multiple values of same parameter

    It searches for the param with the name, and changes the value (and other properties of the parameter) I don't think this is possible with the default parameters in the TRestRequest. You have to fetch the TRestRequest parameter and use the .AddValue method i think.
  23. Thats very strange, You have assigned the correct TRestclient to the Request? I use 2 seperate (3 actually), TRestclients: * 1 for the requests * 1 for the Authorization * 1 for uploads (large files) So i can keep them seperate because they differ a little bit somesitimes (BaseURL especially) Preperation: function THSMSGraphAPI.NewRestClient(const ABaseURI: string): TRESTClient; begin Result := TRESTClient.Create(ABaseURI); Result.SecureProtocols := [THTTPSecureProtocol.TLS12, THTTPSecureProtocol.TLS13]; if not UserAgent.IsEmpty then Result.UserAgent := UserAgent; Result.ProxyServer := ProxyServer; Result.ProxyPort := ProxyPort; end; procedure THSMSGraphAPI.CheckClients; begin if not Assigned(FRestClient) then FRestClient := NewRestClient(CNST_MSGRAPH_BASEURL); if not Assigned(FAuthClient) then FAuthClient := NewRestClient(CNST_MICROSOFT_AccessTokenEndpoint.Replace(CNST_TENANTNAME, TenantName, [rfReplaceAll, rfIgnoreCase])); if not Assigned(FUplClient) then FUplClient := NewRestClient(''); end; procedure THSMSGraphAPI.CheckCreds; begin CheckClients(); if not DoCheckAuthorisation() then raise Exception.Create('Authorization fail.'); FRestClient.AddAuthParameter('Authorization','Bearer ' + AccessToken, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); end; [code] warning, i only use client_credentials as grant_type a simple routine [code] function THSMSGraphAPI.FindCalendar(const ACalendarName: string; var ACalendarID: string; const ASkipCreds :Boolean): Boolean; var cal : TMSGraphCalendarListItem; cals : TMSGraphCalendarListItems; req : TRESTRequest; begin Result := False; ACalendarID := ''; if not ASkipCreds then CheckCreds(); req := TRESTRequest.Create(nil); try req.Client := FRestClient; req.Method := TRESTRequestMethod.rmGET; req.Resource := CNST_RESOURCE_LISTCALENDARS.Replace(CNST_SENDASEMAILADDRESS, AccountEmailAddress, [rfReplaceAll, rfIgnoreCase]); req.Execute(); if not LogInvalidResponse(req.Response, True, 'THSMSGraphAPI.FindCalendar') then begin TgoBsonSerializer.Deserialize(req.Response.Content, cals); for cal in cals.Value do if (cal.name=ACalendarName) then begin ACalendarID := cal.id; break; end; end; finally Result := not ACalendarID.IsEmpty; req.Free; end; end; (ps this code was just a quick way to get the calendar i needed, have to expand to the search/filter possibilities from MSGRaph API) i always create the clients&requests by hand in my final code.
  24. very strange, try this 🙂 FRestClient.AddAuthParameter('Authorization','Bearer ' + AccessToken, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); so, add the param to the client instead of the request, and use AddAuthParameter for this. (maybe try with settings this in the request also). tried all kind of variants, even pasted your code line, here it always works., you tried it with Execute instead of ExecuteAsync i think you should try a bit harder to get a proxy running for debugging this kind of stuf, works the best to find out differences. the different variants i tried, the last one is copied from your code posted here: // req.Resource := cExtensionResource; // FRestClient.AddAuthParameter('Authorization','Bearer ' + AccessToken, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); // req.AddParameter('Authorization','Bearer ' + AccessToken, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); // req.Params.AddItem('Authorization','Bearer ' + AccessToken, pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); req.Params.AddItem('Authorization', 'Bearer ' + AccessToken, TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]); req.Resource := cExtensionResource; req.Execute();
×