JAVASDK示例代码
public static void main(String[] args) {
AipOcr client = new AipOcr("APPID", "APIKEY", "APPSECRET");
String url = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg3.duitang.com%2Fuploads%2Fitem%2F201604%2F04%2F20160404125401_aCUWA.jpeg&refer=http%3A%2F%2Fimg3.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611726347&t=0f88a2379e6a2e6184f3066d9212445b";
JSONObject object = client.webImageUrl(url, null);
System.out.println(object.toString(2));
}
接口返回内容
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/maven/maven-repository/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/maven/maven-repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[main] INFO com.baidu.aip.client.BaseClient - get access_token success. current state: STATE_AIP_AUTH_OK
{
"log_id": 6421445829693934364,
"words_result": [
{"words": "与你拇遇"},
{"words": "好幸运"}
],
"words_result_num": 2
}