Joe Sansalone
Members-
Content Count
92 -
Joined
-
Last visited
Everything posted by Joe Sansalone
-
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone posted a topic in Network, Cloud and Web
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 -
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone replied to Joe Sansalone's topic in Network, Cloud and Web
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. -
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone replied to Joe Sansalone's topic in Network, Cloud and Web
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. -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
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. -
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?
-
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
I understand. BUT, I need: MediaUrl=value1&MediaUrl=value2&MediaUrl=value3 same parameter multiple times. -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
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? -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
ok, I'll try the parameterless AddItem function ... thanks. -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
The server is expecting same name parameter multiple times. But the TRestRequest.Params don't support adding the same parameter name again. -
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
-
What's easier? Same Apple ID but developer access on 2 different App Store accounts? Or different Apple IDs - 1 for each different account?
-
ok great thanks!
-
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
-
Ok, I'll try this out.
-
Thanks Sriram.
-
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
-
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
-
In App Purchase (consumable and subscription)
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
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. -
In App Purchase (consumable and subscription)
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
Thanks for the links. Does the current version Delphi 11.2 support In-App Subscriptions on iOS? -
Hi, What resolution do we need to have in the Launch Image 2x and 3x? Joe
-
very useful .. thanks!
-
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
-
Thank you ... I was looking in the wrong place!
-
I'm also looking to use Firebase push notification for iOS (and Android). Is there a good starting point documentation somewhere?
-
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