财政类票据ocr、增值税发票识别、全电票ocr接口是一项重要的技术创新,在数字化、信息化高速发展的商业环境中发挥着至关重要的作用 。通过集成翔云API,可快速实现发票信息的自动化识别提取与真伪查验,提升了财务管理效率。
就发票识别接口,提供Java语言代码,有需要的人员可在线免费测试:
package com.test;
import okhttp3.;
import org.json.JSONObject;
import java.io.;
/**
- 需要添加依赖
-
com.squareup.okhttp3
-
okhttp
-
4.12.0
*/
class Sample {
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
public static void main(String []args) throws IOException{
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("img","/9j")
.addFormDataPart("key","M***********g")
.addFormDataPart("secret","3***********6")
.addFormDataPart("typeId","20090")
.addFormDataPart("format","json")
.build();
Request request = new Request.Builder()
.url("https://netocr.com/api/v2/recogInvoiveBase64.do")
.method("POST", body)
.build();
Response response = HTTP_CLIENT.newCall(request).execute();
System.out.println(response.body().string());
}
}
标签:ocr,JAVA,addFormDataPart,接口,build,发票,识别 From: https://www.cnblogs.com/netocr/p/18082837