This commit is contained in:
rodkings
2015-04-21 13:07:50 -06:00
parent f3e38aa248
commit 96d44bc8a0

View File

@@ -1,4 +1,8 @@
using Untappd.Net.Exception;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Untappd.Net.Request
{
@@ -6,17 +10,18 @@ namespace Untappd.Net.Request
{
protected abstract string _EndPoint { get; }
/// <summary>
/// Pass in the url parameter into the request...ie username, brewery, etc.
/// Pass in the parameter into the request...ie username, brewery, etc.
/// </summary>
/// <param name="parameter">this can be null if request has no url params</param>
/// <param name="parameter"></param>
/// <returns></returns>
internal string EndPoint(string parameter)
internal string EndPoint(string parameter = "")
{
if (string.IsNullOrWhiteSpace(_EndPoint))
if (!String.IsNullOrEmpty(parameter))
{
throw new EndpointConfigurationException();
parameter = string.Format("/{0}", parameter);
return string.Format(_EndPoint, parameter);
}
return string.Format(_EndPoint, parameter);
return string.Format(_EndPoint, string.Empty);
}
}
}