我想缩短我的网址,但希望以定制的方式。
我用这个
HttpClient client = new DefaultHttpClient();
String urlTemplate = "http://tinyurl.com/api-create.php?url=%s";
String uri = String.format(urlTemplate, URLEncoder.encode(l));
HttpGet request = new HttpGet(uri);
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
InputStream in = entity.getContent();
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == HttpStatus.SC_OK) {
// TODO: Support other encodings
String enc = "utf-8";
Reader reader = new InputStreamReader(in, enc);
BufferedReader bufferedReader = new BufferedReader(reader);
String tinyUrl = bufferedReader.readLine();
但这给了我一个以 tinyurl 开头的链接,但我想要一个自定义 url,如“zaiff.co/mynum/mycode”。google ar 第三方是否有任何 api 可以做到这一点?