I have sent this to support, I literally forgot about the forum, so here goes:
I have the VCL cloud pack and am trying the FMX version. Because of limitations with the VCL and FMX TMS component some time ago we had to purchase a different Dropbox component. However i now see that FMX.TMSCloudDropbox has a method called HTTPPUT (as well as other options). This is fantastic news for us and will allow us to use only the TMS components (I do not see the same methods with the VCL version and stumbled onto it in the FMX version by accident).
TMS documentation is very sparse and really only goes into common aspects as one document tries to be a manual for all cloud services so it is very limited and missing quite a bit. I have looked through the demos and they are equally sparse with no examples of HTTPPUT and have looked through the forum, again nothing. What would the code look like to send the Dropbox command "/sharing/list_folders". I have left in Bold the parts I just don"t know what to put? Since I cannot find any documentation or examples that cover this method (or these methods), can you please complete so that I might continue on with the FMX Cloud Pack Demo (which would be worth purchasing for this feature alone)???
TTMSFMXCloudDropbox.HttpsPut(DROPBOX_BASE_URL + "/sharing/list_folders", tgtdir,tgtfn, CustomHeaders, CustomData, hcput); NOTE: I assume the final parameter is hcput, b ut I could be wrong?
Again, many assumptions, I assume the URL is the full URL of REST call. In this case it is:
I further assume the Command (last parameter) is "hcput" which seems redundant since I am performing a HttpsPut? The other parameters then no idea. A little documentation and example would go a long way.
Anyway, any help appreciated especially an example with notes, ie. the URL is XXXX and of the form yyyyy?
As noted, this is a potential big deal for me. I can simply get rid of a component and all of my internal modding to return simply the JSON string result which I already have code that parses it correctly.
First of all, please note that the HttpsPut (and related) methods are shared between multiple controls in the TMS FMX Cloud Pack which is why the last parameter so we are able to differentiate what happens for different controls.
About the "tgtdir" and "tgtfn" parameters. These refer to the target directory and target filename which are required when uploading files which the HttpsPut method is used for.
About the "CustomHeaders" and "CustomData" parameters. These can be used to add headers and data to the HttpRequest if required.
The documentation mentions a POST request instead of a PUT request for this particular endpoint. So I would recommend using HttpsPost instead.
Yes a Freudian slip, it should be HTTPSPost (which is what it is in my code using the other component) and not HTTPPut. I see where the he target folder and target file name are required for the Put endpoint.
As you note, the code is common for many/all types of cloud software. That?s the problem I?m having, in that I?m finding the documentation confusing and (for me at least) incomplete. For example, the HTTPPut / HTTPPost / HTTPxxxx isn?t documented anywhere that I can find and I stumbled on it by accident. I don?t see it with the VCL Cloud Pack, I have no idea whether it?s available.
For me, I need those methods since TMS CloudItems/TMS Dropboxitems fails to return IMHO VERY IMPORTANT folder properties. Again, for example, I cannot see where the Folder share name is returned (you need this to determine whether the folder is shared). The Dropbox Folder ID is NOT returned. Without that you simply cannot get a list of the folder members (if you could determine whether the folder was shared in the first place).
This is pivotal. Dropbox is about folder and file sharing yet the TMS component (again as far as I can see) does not return the folder properties needed to work out what?s going on with sharing. So the ?workaround? is to use the HTTPPost and do the JSON decode myself.
So thanks for the pointer WRT TTMSFMXDropbox.pas, I?ll follow up there.
Adding the required request manually can indeed be a temporary solution until it get's implemented by us in the component.
Please note that the HTTP request methods are also available in the TMS VCL Cloud Pack as most of the base code is shared.
As there is only need to use the HTTP requests when you want to use API functionality that is not already available in the many components. For most users the available functionality is sufficient.
However we'll try to expand and improve the documentation in the future.
By the way, the exact filename where the example HTTP requests for DropBox can be found is: CloudCustomDropBox.pas for TMS VCL Cloud Pack and FMX.TMSCloudCustomDropBox.pas for TMS FMX Cloud Pack.
Thanks. I have purchased the VCL cloud pack so can look at the code there. We are evaluating the FMX Cloud Pack so do not have the source so cannot evaluate the code in FMX.TMSCloudCustomDropBox.pas.
Is there any difference in the VCL HttpsPost call and the FMX HttpsPost call?
[dcc32 Error] TMSFMXCloudTest.pas(107): E2250 There is no overloaded version of 'HttpsPost' that can be called with these arguments
My Test Code below. The parameters are (string, string, TCoreCloudHeaders, string, string, THTTPCommand) and according to the function template (since there is no documentation I can find) that's what should be expected:
Note: ExtractServer and RemoveServer are in CloudBase.pas and return strings.
That actually workedwhich is VERY confusing because when I hover over any HTTPSPost() I get this:
Which for some reason doesn't work. I have displayed this image in Chrome and in Safari and it displays correctly. Your forum software says it's invalid:
file:///Users/kevin/Downloads/HTTPSPost.png
Regardless, when I hover over the HTTPSPost command this is displayed and copied directly from the IDE, it is quite explicit: