public HttpAddress(string baseAddress, RestApiVersion version, List<string> resources, Dictionary<string, object> parameters) { this.baseAddress = baseAddress; this.version = version; this.resources = resources; this.parameters = parameters; }
/// <summary> /// Initializes a new instance of the <see cref="RestContext"/> class. /// </summary> /// <param name="baseAddress">Base address (URL).</param> /// <param name="applicationName">Application name.</param> /// <param name="applicationApiKey">Application API key.</param> /// <param name="sessionId">SessionId to be added to base headers.</param> /// <param name="httpFacade">User defined instance of <see cref="IHttpFacade"/>.</param> /// <param name="serializer">User defined instance of <see cref="IContentSerializer"/>.</param> /// <param name="apiVersion">REST API version to use.</param> public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, IHttpFacade httpFacade, IContentSerializer serializer, RestApiVersion apiVersion = RestApiVersion.V2) { HttpUtils.CheckUrlString(baseAddress); if (applicationName == null) { throw new ArgumentNullException("applicationName"); } if (applicationApiKey == null) { throw new ArgumentNullException("applicationApiKey"); } if (httpFacade == null) { throw new ArgumentNullException("httpFacade"); } if (serializer == null) { throw new ArgumentNullException("serializer"); } address = new HttpAddress(baseAddress, apiVersion); HttpFacade = httpFacade; ContentSerializer = serializer; SetBaseHeaders(applicationName, applicationApiKey, sessionId); Factory = new ServiceFactory(address, HttpFacade, ContentSerializer, httpHeaders); }
public HttpAddress(string baseAddress, RestApiVersion version, List <string> resources, Dictionary <string, object> parameters) { this.baseAddress = baseAddress; this.version = version; this.resources = resources; this.parameters = parameters; }
public HttpAddress(string baseAddress, RestApiVersion version) { this.baseAddress = baseAddress; this.version = version; resources = new List<string>(); parameters = new Dictionary<string, object>(); }
public HttpAddress(string baseAddress, RestApiVersion version) { this.baseAddress = baseAddress; this.version = version; resources = new List <string>(); parameters = new Dictionary <string, object>(); }
/// <summary> /// Initializes a new instance of the <see cref="RestContext"/> class. /// </summary> /// <param name="baseAddress">Base address (URL).</param> /// <param name="applicationName">Application name.</param> /// <param name="applicationApiKey">Application API key.</param> /// <param name="sessionId">SessionId to be added to base headers.</param> /// <param name="apiVersion">REST API version to use.</param> public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, RestApiVersion apiVersion = RestApiVersion.V2) : this(baseAddress, applicationName, applicationApiKey, sessionId, new UnirestHttpFacade(), new JsonContentSerializer(), apiVersion) { }
/// <summary> /// Initializes a new instance of the <see cref="RestContext"/> class. /// </summary> /// <param name="baseAddress">Base address (URL).</param> /// <param name="apiVersion">REST API version to use.</param> public RestContext(string baseAddress, RestApiVersion apiVersion = RestApiVersion.V1) : this(baseAddress, new UnirestHttpFacade(), new JsonContentSerializer(), apiVersion) { }
public IHttpAddress WithVersion(RestApiVersion value) { return new HttpAddress(baseAddress, value, resources, parameters); }
public IHttpAddress WithVersion(RestApiVersion value) { return(new HttpAddress(baseAddress, value, resources, parameters)); }