public JSONObject sendImageRequest(String url, byte[] image, HashMap<String, Object> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        String content = Base64Util.encode(image);
        request.addBody("image", content);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(url);
        request.addHeader(Headers.CONTENT_ENCODING,
                HttpCharacterEncoding.ENCODE_UTF8);
        request.addHeader(Headers.CONTENT_TYPE, HttpContentType.JSON_DATA);
        request.setBodyFormat(EBodyFormat.RAW_JSON);
        postOperation(request);
        return requestServer(request);
    }
public JSONObject sendImageRequest ( String url , byte [ ] image , HashMap < String , Object > options ) { AipRequest request = new AipRequest ( ) ; preOperation ( request ) ; String content = Base64Util . encode ( image ) ; request . addBody ( "image" , content ) ; if ( options != null ) { request . addBody ( options ) ; } request . setUri ( url ) ; request . addHeader ( Headers . CONTENT_ENCODING , HttpCharacterEncoding . ENCODE_UTF8 ) ; request . addHeader ( Headers . CONTENT_TYPE , HttpContentType . JSON_DATA ) ; request . setBodyFormat ( EBodyFormat . RAW_JSON ) ; postOperation ( request ) ; return requestServer ( request ) ; }
easyDL通用请求方法
@param url 服务的url
@param image 图片二进制数据
@param options 可选参数
@return Json返回