API | Description |
Submits a webpage moderation job. | |
Queries the result of the specified webpage moderation job. |
QCloudPostWebRecognitionRequest
) is used to submit a webpage moderation job. The job can be queried by JobId
.QCloudPostWebRecognitionRequest * request = [[QCloudPostWebRecognitionRequest alloc]init];// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// File regionrequest.regionName = @"regionName";request.url = @"www.****.com";// Moderation type, such as `porn` (pornography), `terrorist` (terrorism), `politics` (politically sensitive), and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionPorn | QCloudRecognitionAds | QCloudRecognitionPolitics | QCloudRecognitionTerrorist;// Moderation policy. If this parameter is not specified, the default policy will be used. For more information, visit https://www.tencentcloud.com/document/product/460/56345?from_cn_redirect=1.request.bizType = BizType;request.finishBlock = ^(QCloudPostWebRecognitionResult * outputObject, NSError *error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostTextRecognitionResult` class};[[QCloudCOSXMLService defaultCOSXML] PostWebRecognition:request];
let request = QCloudPostWebRecognitionRequest();// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".request.url = "www.***.com";// File regionrequest.regionName = "regionName";// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// Moderation type, such as `porn` (pornography), `terrorist` (terrorism), `politics` (politically sensitive), and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionEnum(rawValue: QCloudRecognitionEnum.porn.rawValue | QCloudRecognitionEnum.ads.rawValue)!// Moderation policy. If this parameter is not specified, the default policy will be used. For more information, visit https://www.tencentcloud.com/document/product/460/56345?from_cn_redirect=1.request.setFinish { outputObject, error in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostTextRecognitionResult` class}QCloudCOSXMLService.defaultCOSXML().postWebRecognition(request);
QCloudGetWebRecognitionRequest
) is used to query the result of the specified webpage moderation job by JobId
.QCloudGetWebRecognitionRequest * request = [[QCloudGetWebRecognitionRequest alloc]init];// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// File regionrequest.regionName = @"regionName";// The `jobid` returned by the `QCloudPostWebRecognitionRequest` APIrequest.jobId = @"jobid";request.finishBlock = ^(QCloudWebRecognitionResult * outputObject, NSError *error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudWebRecognitionResult` class};[[QCloudCOSXMLService defaultCOSXML] GetWebRecognition:request];
let request = QCloudGetWebRecognitionRequest();// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// File regionrequest.regionName = "regionName";// The `jobid` returned by the `QCloudPostWebRecognitionRequest` APIrequest.jobId = "jobid";request.setFinish { outputObject, error in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudWebRecognitionResult` class};QCloudCOSXMLService.defaultCOSXML().getWebRecognition(request);
Was this page helpful?