Creating an Instance of ObsClient
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
ObsClient functions as the .NET client for accessing OBS. It offers callers a series of APIs for interaction with OBS and is used for managing and operating resources, such as buckets and objects, stored in OBS. To use OBS .NET SDK to send a request to OBS, you need to initialize an instance of ObsClient and modify the default configurations in ObsConfig based on needs.
- If you use the endpoint to create an instance of ObsClient, all parameters are in their default values and cannot be modified.
// Create an instance of ObsClient.
ObsClient client = new ObsClient("*** Provide your Access Key ***", "*** Provide your Secret Key ***", "https://your-endpoint");
// Use the instance to access OBS.
- If you use the ObsConfig configuration class to create an instance of ObsClient, you can set any parameters as needed during the creation. After the instance has been created, the parameters cannot be modified. For parameter details, see Configuring an Instance of ObsClient
// Create an instance of ObsConfig.
ObsConfig config = new ObsConfig();
config.Endpoint = "https://your-endpoint";
// Create an instance of ObsClient.
ObsClient client = new ObsClient("*** Provide your Access Key ***", "*** Provide your Secret Key ***", config);
// Use the instance to access OBS.
- The project can contain one or more instances of ObsClient.
- ObsClient is thread-safe and can be simultaneously used by multiple threads.
Last Article: Configuring the AK/SK
Next Article: Configuring an Instance of ObsClient
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.