热门搜索 : 电子合同   签署   产品
首页 > 文档中心 > 车牌号OCR识别 > 示范代码
NSString *httpUrl = @"https://v.1dq.com/api/c9/license";
NSString *httpArg = @"key=您申请的key&base64string=";
[self request: httpUrl withHttpArg: httpArg];

-(void)request: (NSString*)httpUrl withHttpArg: (NSString*)HttpArg  {
    NSString *urlStr = [[NSString alloc]initWithFormat: @"%@?%@", httpUrl, HttpArg];
    NSURL *url = [NSURL URLWithString: urlStr];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 10];
    [request setHTTPMethod: @"GET"];
    [NSURLConnection sendAsynchronousRequest: request
        queue: [NSOperationQueue mainQueue]
        completionHandler: ^(NSURLResponse *response, NSData *data, NSError *error){
            if (error) {
                NSLog(@"Httperror: %@%ld", error.localizedDescription, error.code);
            } else {
                NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode];
                NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                NSLog(@"HttpResponseCode:%ld", responseCode);
                NSLog(@"HttpResponseBody %@",responseString);
            }
        }];
}

现在注册,免费试用所有产品

免费体验

电话咨询

关注我们

微信公众号