In using Kinvey, I want to make sure all communications are done via https. It looks like the protocol for communicating with Kinvey defaults to https, but could someone tell me please how set the Kinvey Google Cloud Storage URLs to https? Right now my Backendfile1.Files.UploadFile() is returning an http url rather than a https url. I know this has to be simple and my brain has just temporarily left me... Many thanks.
I did and I cannot express enough how helpful they were. But I could not figure out the https issue and how to stop the REST Request Timed Out error message when uploading a file (so I could give something more meaningful). So I appreciate your help.
BTW, XE8 is amazing. The speed of the compiler is awesome. Our app is quite complex and before I had to constantly restart XE7 because of crashing, even after just changing a line of code. So such thing now. So whatever internal changes were made in XE8 have really made it a great development environment. So so happy I upgraded!
For the time out message, you should be able to catch the exception and display your own message.
Regarding https, you can use either 'http:' or 'https:' when making a request to Google. Kinvey uses Google cloud storage for files.
Here's some info from Kinvey on it:
So, the solution is to modify the URLs we get from Kinvey to have an 'https:' prefix. You will need to edit the
REST.Backend.KinveyAPI source file found in source/data/rest/.
I would recommend saving a copy of the file in the same folder as your project. Then add the file to your project in Delphi XE8, and select to use
Here are the changes you will need to make to the REST.Backend.KinveyAPI source file:
1. We need a routine to change the prefix. Add this routine somewhere:
function ForceHTTPS(const AURL: string): string;
if AURL.StartsWith('http:') then
Result := 'https:' + AURL.Substring(5)
Result := AURL;
2. Modify the URL for upload (in TKinveyApi.RetrieveFile):
LJSONValue := LResponseObject.GetValue('_uploadURL'); // Do not localize
if LJSONValue <> nil then
LUploadURL := LJSONValue.Value;
Assert(LUploadURL <> '');
// Change to HTTPS
LUploadURL := ForceHTTPS(LUploadURL);
3. Modify the URL to download (TKinveyAPI.RetrieveFile):
LResponse := FRequest.Response.JSONValue as TJSONObject;
AFile := FileFromObject(LResponse);
// Change to HTTPS
AFile.FDownloadURL := ForceHTTPS(AFile.FDownloadURL);
if Assigned(AJSON) then
AJSON.AddElement(LResponse.Clone as TJSONObject);
if Assigned(AProc) then