Release Notes
Announcements
x-cos-meta-, end with a custom suffix, and are saved as part of the object metadata.Pic-Operations header to enable automatic image processing. For detailed API instructions, see Persistence Processing.// The bucket region can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket/. For more information about regions, see https://www.tencentcloud.com/document/product/436/6224.String region = "ap-beijing"; // Bucket regionString commonHeaderKey = "commonexamplekey"; // Key of the custom common headerString commonHeaderValue = "commonexamplevalue"; // Value of the custom common headerString requestHeaderKey = "requestexamplekey"; // Key of the custom request headerString requestHeaderValue = "requestexamplevalue"; // Value of the custom request headerCosXmlServiceConfig cosXmlServiceConfig = new CosXmlServiceConfig.Builder().isHttps(true).setRegion(region).setDebuggable(false)// Add a custom common header to each request.addHeader(commonHeaderKey, commonHeaderValue).builder();CosXmlService cosXmlService = new CosXmlService(context, cosXmlServiceConfig,credentialProvider);// Add a custom header with higher priority than common headers to a single requestHeadObjectRequest headObjectRequest = new HeadObjectRequest(bucket, cosPath);try {headObjectRequest.setRequestHeaders(requestHeaderKey, requestHeaderValue, false);} catch (CosXmlClientException e) {e.printStackTrace();}// Initiate a requestcosXmlService.headObjectAsync(headObjectRequest, new CosXmlResultListener() {@Overridepublic void onSuccess(CosXmlRequest request, CosXmlResult result) {HeadObjectResult headObjectResult = (HeadObjectResult) result;}@Overridepublic void onFail(CosXmlRequest request, CosXmlClientException clientException,CosXmlServiceException serviceException) {if (clientException != null) {clientException.printStackTrace();} else {serviceException.printStackTrace();}}});
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários