Jump to content

Joe Sansalone

Members
  • Content Count

    92
  • Joined

  • Last visited

Everything posted by Joe Sansalone

  1. Hi, I have a Indy HTTP server application. Currently receiving requests in the format: application/x-www-form-urlencoded. (everything works fine, I use the parsed params). I'm now also receiving Posts from SendGrid: "the post will be multipart/form-data with the email content URL encoded, but the attachments will be in multipart/form-data". Using the TIdHTTPRequestInfo.PostStream, I'm able to view the payload that they are sending me. 1. Do I need to URLDecode the email content or is it already decoded? 2. Are there any functions/classes to help parse the form-data? it looks like this: --XYzZY Content-Disposition: form-data; name="from" Joe S. <joes1234@gmail.com> --XYzZY Content-Disposition: form-data; name="text" Hello, I'm testing this email. Joe --XYzZY Content-Disposition: form-data; name="to" mb12345@parsetest.projectone.ca --XYzZY Content-Disposition: form-data; name="subject" Subject123
  2. Thank you for the code. I realize that I was doing a quick "custom" version just for text and utf8. (and boundary was the same string always coming from SendGrid). It was my attempt to get something working (my application simply needed some Form-data fields coming in). We are lucky to have you in this forum! I'll try out your code. Thanks.
  3. I'm simply doing a aRequestInfo.PostStream.Position := 0; StringList.LoadFromStream(aRequestInfo.POstStream, TEncoding.UTF8); to get the content into a string list. Then, I'll be looping through each line of the stringlist looking for Content-Disposition: form-data; name="xxx" and getting the NAME of the parameter (i.e. xxx). Then skipping a line and taking every line until --XYzZY, to get the VALUE of the name parameter. I think it will work for anything without attachments.
  4. Joe Sansalone

    trying to POST multiple values of same parameter

    OK, I got it to work via: tempBody := 'Param1=' + value1 + '&' + 'Param2=' + value2 + '&' ... etc; // build the parameters with & in-between each parameter RestRequest.Params.AddItem('Body1234', tempBody, pkREQUESTBODY, [poDoNotEncode]); // notice that there needs to be a unique name even for the entire body of parameters.
  5. I'm trying to add the same parameter name multiple times with different values (using POST). It seems like separating values via semi-colon ; and using poFlatArray only works for a GET request. FRestRequest.Params.AddItem('MediaUrl', values , TRestRequestParameterKind.pkGETorPOST, [poFlatArray]); Simply doing multiple AddItem erases previous entry if the parameter name is the same. So, How do I add the same parameter multiple times?
  6. Joe Sansalone

    trying to POST multiple values of same parameter

    I understand. BUT, I need: MediaUrl=value1&MediaUrl=value2&MediaUrl=value3 same parameter multiple times.
  7. Joe Sansalone

    trying to POST multiple values of same parameter

    I tried and it's not working. Is there a way to output the HTTP request text? The actual text that is being sent for the whole request?
  8. Joe Sansalone

    trying to POST multiple values of same parameter

    ok, I'll try the parameterless AddItem function ... thanks.
  9. Joe Sansalone

    trying to POST multiple values of same parameter

    The server is expecting same name parameter multiple times. But the TRestRequest.Params don't support adding the same parameter name again.
  10. Joe Sansalone

    multiple developer (iOS) accounts

    Hi, I'll be developing an app with a different developer account in the same Delphi IDE. Does Delphi support multiple iOS developer accounts? I want to be sure before I try ... Joe
  11. Joe Sansalone

    multiple developer (iOS) accounts

    What's easier? Same Apple ID but developer access on 2 different App Store accounts? Or different Apple IDs - 1 for each different account?
  12. Joe Sansalone

    multiple developer (iOS) accounts

    ok great thanks!
  13. Joe Sansalone

    IBX & FireDAC, Change Views

    Hi, If I set a subscription active in a transaction and then execute "Select * from Table1", how do I check if a field has been updated, or row has been deleted or inserted (other than using IS Updated, or IS Inserted in the SQL). Is it a new property of TDataSet or TField?? Joe
  14. Joe Sansalone

    IBX & FireDAC, Change Views

    Ok, I'll try this out.
  15. Joe Sansalone

    IBX & FireDAC, Change Views

    Thanks Sriram.
  16. Joe Sansalone

    macbook pro M1, running Delphi IDE

    Hi, I'm looking to get a macbook pro (M1) and run Windows under Parallels to develop using the Delphi IDE. Not sure Windows/Parallels is fully ready for the M1 macbook. But I was wondering if any developer has tried this OR if there's anyone from Embarcadero looking into this ... to make sure it'll work. Any info would be appreciated. Joe
  17. Hi, I'm looking to use InApp purchase in an iOS and Android app created with Delphi. According to ChatGPT, the code below will work and also work with for a subscription based purchase. IS THIS CORRECT? uses FMX.InAppPurchase; var InAppPurchase: TInAppPurchase; ProductIdentifier: string; begin InAppPurchase := TInAppPurchase.Create; try // Set up the product identifier for the consumable IAP ProductIdentifier := 'com.yourcompany.yourproduct.consumable'; // <-- if subscription, 'com.yourcompany.yourproduct.subscription'; // Request product information from the App Store InAppPurchase.RequestProductInfo(ProductIdentifier); // Wait for the product information to be returned while not InAppPurchase.ProductInfoReceived do begin Application.ProcessMessages; Sleep(100); end; // Check if the product is valid and available for purchase if InAppPurchase.ProductValid then begin // Show the purchase dialog to the user InAppPurchase.PurchaseProduct(ProductIdentifier); // Wait for the purchase to complete while not InAppPurchase.PurchaseComplete do begin Application.ProcessMessages; Sleep(100); end; // Check if the purchase was successful if InAppPurchase.PurchaseSuccess then begin // Grant the user access to the purchased content // or Add the item to the user inventory or do whatever you want after the purchase end else ShowMessage('Purchase failed'); end else ShowMessage('Product not available'); finally InAppPurchase.Free; end; end; Joe
  18. Joe Sansalone

    In App Purchase (consumable and subscription)

    Was In-App Subscriptions (weekly, monthly, yearly) something that was added recently? I don't know why, but I remember Subscriptions not being supported. Just consumables purchases and non-consumable purchases.
  19. Joe Sansalone

    In App Purchase (consumable and subscription)

    Thanks for the links. Does the current version Delphi 11.2 support In-App Subscriptions on iOS?
  20. Joe Sansalone

    iOS Launch Image 2x, 3x?

    Hi, What resolution do we need to have in the Launch Image 2x and 3x? Joe
  21. Joe Sansalone

    iOS Launch Image 2x, 3x?

    very useful .. thanks!
  22. Joe Sansalone

    iPhone statusbar color

    Hi, I remember something in the most recent versions of Delphi, that we can enable iOS mobile app to also include the top statusbar on iPhone ... make it same color like form. Do we need to set a global var in project source file? If so, what is it? I totally forgot. Thanks, Joe
  23. Joe Sansalone

    iPhone statusbar color

    Thank you ... I was looking in the wrong place!
  24. Joe Sansalone

    Firebase Push Notification for IOS

    I'm also looking to use Firebase push notification for iOS (and Android). Is there a good starting point documentation somewhere?
  25. Joe Sansalone

    browsing path

    Hi, Using Delphi 11.2. Installed Radiant Shapes from GetIt. Clicking on a class type (ex: TRadiantShape) in code does NOT bring me to the source. So I put the source location in the Browsing Path. Still doesn't work. I could put the location in the Library Path but then it will compile the units every time. Isn't the Browsing Path used for jumping into source via editor when the library path has the *.dcu file location? This way compiles faster because using DCUs and still can look at source because in Browsing Path. Is this a 11.2 bug? Joe
×