歪枣网上验证码识别API接口包括纯数字验证码、纯英文验证码、英数混合验证码等形式验证码识别。
1、JAVA版本识别例子代码如下:
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
public class TestMain {
public static void main(String[] args) {
Map<String, Object> params = new HashMap();
params.put("image", "上传image");
params.put("token", "歪枣网上登录获取token");
params.put("models", "1003");
String ocrRst = post("http://api.waizaowang.com/ai/captcha", params);
System.out.println(ocrRst);
}
public static String post(String strUrl, Map<String, Object> params) {
try {
StringBuilder postParams = new StringBuilder();
for (Map.Entry<String, Object> param : params.entrySet()) {
if (postParams.length() != 0) {
p