检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
Console.WriteLine("Status: {0}", response.Configuration.Status); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
Console.WriteLine("copy object response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
Console.WriteLine("Get bucket logging response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
Console.WriteLine("Get bucket website response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
You can perform the following to implement website file hosting: Upload a website file to your bucket in OBS as an object and set the MIME type for the object. Set the object ACL to public read. Access the object using a browser.
Console.WriteLine("StorageClass: {0}", response.StorageClass); Console.WriteLine("Location: {0}", response.Location); } catch (ObsException ex) { Console.WriteLine("StatusCode: {0}", ex.StatusCode); } To handle the error codes possibly returned during the operation, see OBS
response.ObjectNumber); Console.WriteLine("Size: {0}", response.Size); } catch (ObsException ex) { Console.WriteLine("ErrorCode: {0}", ex.ErrorCode); Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage); } To handle the error codes possibly returned during the operation, see OBS
ObsClient client = new ObsClient(accessKey, secretKey, config); // Upload a stream. try { String str = "Hello OBS"; Stream stream = new MemoryStream(System.Text.Encoding.Default.GetBytes(str)); PutObjectRequest request = new PutObjectRequest() { BucketName
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient([ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
If there is no default master key, OBS will create one and use it by default.
The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
tagging HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.region.myhuaweicloud.com Accept: */* Date: Wed, 27 Jun 2018 13:22:50 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:Pf1ZyGvVYg2BzOjokZ/BAeR1mEQ= Content-SHA256: ogX9qClMrVJUBiUSIKDFM0qO41jJM0I5SCN55/OtMyI= Content-Length
// require 'obs-autoloader.php'; // Declare the namespace. use Obs\ObsClient; // Create an instance of ObsClient. $obsClient = new ObsClient ( [ //Obtain an AK/SK pair using environment variables or import the AK/SK pair in other ways.
To use OBS BrowserJS SDK to send a request to OBS, you need to initialize an instance of ObsClient and modify parameters related to initial configurations of the instance based on actual needs.
e.printStackTrace(); } } } OBS SDK for Java supports integrity check with both MD5 and SHA256 (SHA256 is recommended for its higher security). Parent topic: FAQs (SDK for Java)
The network connection to the OBS server breaks often. Sizes of files to be uploaded are uncertain.
It is provided for the OBS server to verify data integrity. The OBS server will compare this MD5 value with the MD5 value calculated based on the object data. If the two values are not the same, HTTP status code 400 is returned.
For details, see Introduction to OBS Access Control, IAM Custom Policies, and Configuring an Object Policy. The mapping between OBS regions and endpoints must comply with what is listed in Regions and Endpoints.
For details about authorization methods, see Differences Between OBS Permissions Control Methods. For details about how to configure permissions, see OBS Custom Policies and Configuring an Object Policy.