IPWorks S3 2020 Node.js Edition

Questions / Feedback?

UseVirtualHosting Property

Determines which URL style to use when making requests.

Syntax

 s3client.getUseVirtualHosting([callback])
 s3client.setUseVirtualHosting( useVirtualHosting, [callback])

Default Value

TRUE

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getUseVirtualHosting([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setUseVirtualHosting([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

If true (default), virtual-hosted-style URLs will be used to make requests: http://yourbucket.s3.amazonaws.com/yourobject. Note that hosted-style URLs impose more bucket name restrictions due to DNS server naming restrictions. Refer to Amazon's documentation for more information.

If false, path-style URLs will be used to make requests: http://s3.amazonaws.com/yourbucket/yourobject.

Important: When using the spAmazonS3 (0) service provider, keep in mind that Amazon has publicly announced that buckets created after September 30, 2020 will only support virtual-hosted-style URLs. Buckets created on or before September 30, 2020 will continue to support both URL styles.

Note: This property is ignored when ServiceProvider is set to one of the following:

  • spAlibaba (6); Alibaba does not support path-style URLs, only virtual-hosted-style URLs.
  • spOracle (8); Oracle Cloud Object Storage does not support virtual-hosted-style URLs, only path-style URLs.

This property is not available at design time.

Data Type

Boolean

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks S3 2020 Node.js Edition - Version 20.0 [Build 7722]