/// <summary> /// Shortens the URL. /// </summary> /// <param name="longUrl">The long URL.</param> /// <returns>Task<JObject>.</returns> /// <exception cref="ArgumentNullException">longUrl</exception> public Task <dynamic> ShortenUrl(string longUrl) { if (longUrl == null) { throw new ArgumentNullException(nameof(longUrl)); } var path = util.createOwlyPath("url", "shorten"); var query = Restler.GetQuery(null, new { apiKey = _connection.ApiKey, longUrl }); return(_connection.get(path, new { query })); }
/// <summary> /// Shortens the URL. /// </summary> /// <param name="longUrl">The long URL.</param> /// <returns>Task<JObject>.</returns> public Task <dynamic> ShortenUrl(string longUrl) { var path = util.createOwlyPath("url", "shorten"); return(_connection.get(path, new { longUrl })); }