Cloud Storage Integrator 2016 .NET Edition
Cloud Storage Integrator 2016 .NET Edition
Questions / Feedback?

SendCustomRequest Method

Sends a custom request to DigitalOcean.

Syntax

[VB.NET]
Public Function SendCustomRequest(ByVal Url As String, ByVal RequestData As String, ByVal OtherHeaders As String) As String
[C#]
public string SendCustomRequest(string url, string requestData, string otherHeaders);

Remarks

SendCustomRequest allows you to send a custom request to DigitalOcean.

If the RequestData parameter is empty, the component will perform an HTTP GET to the URL you specify. The component will automatically generate a proper signature and timestamp, but you are responsible for providing all of the required and optional parameters through the Url parameter, as required by the DigitalOcean documentation. The OtherHeaders parameter is used to submit any additional headers you require.

You may also submit RequestData in an HTTP PUT to the Url you specify. The Url is normally fully-qualified, but for PUTs it may be a relative path instead. If a relative path is supplied, the DigitalOcean URL is used as the remote host, the Bucket property is used to create the path, and the Url parameter is used as the object.

When SignCustomRequest is False, you are responsible for generating a proper signature, timestamp, and providing all of the required and optional parameters through the Url parameter, as required by the DigitalOcean documentation. The component will pass the request as-is without modification.

In addition to the default supported operations, HTTPMethod can be set to specify the HTTP Method that you wish to perform.

This method will return the entire HTTP response as a result of the call. The GetXValue method can be used to fetch response information using XPath after a successful call to SendCustomRequest.

For example, to submit a Versioning Configuration request, you would use the following code:

  string request = "<VersioningConfiguration xmlns=\"http://nyc3.digitaloceanspaces.com/doc/2006-03-01/\">\r\n<Status>Enabled</Status>\r\n</VersioningConfiguration>";
  digitalocean.SendCustomRequest("http://nyc3.digitaloceanspaces.com/versioningtestlive/?versioning", request, "");

To submit the same request when using Virtual Hosting, you would use the this code instead:

  digitalocean.SendCustomRequest("http://versioningtestlive.nyc3.digitaloceanspaces.com/?versioning", request, "");

Finally, you may specify the Bucket and put the object name in the Url parameter as shown below, in which case the component will determine the URL to submit to based on the value of the UseVirtualHosting property:

  digitalocean.Bucket = "versioningtestlive";
  digitalocean.SendCustomRequest("versioning", request, "");

 
 
Copyright (c) 2019 /n software inc. - All rights reserved.
Cloud Storage Integrator 2016 .NET Edition - Version 16.0 [Build 7239]