
In past 2 posts you saw how short URLs can be expanded using the Google URL shortener API. This post shows how URLs can be shortened using this API.
API key is not mandatory for test purpose. Use this link to get an API key.
For shortening URLs, 2 points must be noted. First, a HTTP POST is required and the post data should be in JSON format. Here is the code:
//This is the URL you want to shorten$longUrl ...
Published on January 11, 2011 22:27