我想缩短我的网址,但希望以自定义方式提供。
我用过这个
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开头的链接,但我想要一个像“zaiff.co/mynum/mycode”这样的自定义网址。谷歌ar第三方有没有这样做api?