public static GetQrcodeResult get_qrcode(String access_token){
		HttpUriRequest httpUriRequest = RequestBuilder.get()
								.setUri(BASE_URI + "/wxa/get_qrcode")
								.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
								.build();
		CloseableHttpResponse httpResponse = LocalHttpClient.execute(httpUriRequest);
		try {
			int status = httpResponse.getStatusLine().getStatusCode();
			Header header = httpResponse.getFirstHeader("Content-disposition");
			if(header != null && header.getValue().endsWith("filename=\"QRCode.jpg\"")){
				if(status == 200){
					byte[] bytes = EntityUtils.toByteArray(httpResponse.getEntity());
					GetQrcodeResult result = new GetQrcodeResult();
					result.setBufferedImage(ImageIO.read(new ByteArrayInputStream(bytes)));
					return result;
				}
			}else{
				String body = EntityUtils.toString(httpResponse.getEntity());
				return JsonUtil.parseObject(body, GetQrcodeResult.class);
			}
		} catch (IOException e) {
			logger.error("", e);
		} finally {
			try {
				httpResponse.close();
			} catch (IOException e) {
				logger.error("", e);
			}
		}
		return null;
	}
public static GetQrcodeResult get_qrcode ( String access_token ) { HttpUriRequest httpUriRequest = RequestBuilder . get ( ) . setUri ( BASE_URI + "/wxa/get_qrcode" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . build ( ) ; CloseableHttpResponse httpResponse = LocalHttpClient . execute ( httpUriRequest ) ; try { int status = httpResponse . getStatusLine ( ) . getStatusCode ( ) ; Header header = httpResponse . getFirstHeader ( "Content-disposition" ) ; if ( header != null && header . getValue ( ) . endsWith ( "filename=\"QRCode.jpg\"" ) ) { if ( status == 200 ) { byte [ ] bytes = EntityUtils . toByteArray ( httpResponse . getEntity ( ) ) ; GetQrcodeResult result = new GetQrcodeResult ( ) ; result . setBufferedImage ( ImageIO . read ( new ByteArrayInputStream ( bytes ) ) ) ; return result ; } } else { String body = EntityUtils . toString ( httpResponse . getEntity ( ) ) ; return JsonUtil . parseObject ( body , GetQrcodeResult . class ) ; } } catch ( IOException e ) { logger . error ( "" , e ) ; } finally { try { httpResponse . close ( ) ; } catch ( IOException e ) { logger . error ( "" , e ) ; } } return null ; }
代码管理<br>
获取体验小程序的体验二维码
@since 2.8.9
@param access_token access_token
@return result