GenerateSignature() public method

public GenerateSignature ( string url ) : string
url string
return string
Ejemplo n.º 1
0
		public void Should_generate_signature_from_url()
		{
			var key = new BusinessKey("clientID", "vNIXE0xscrmjlyV-12Nj_BvUPaw=");

			string signedUrl = key.GenerateSignature("http://maps.googleapis.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID");

			Assert.NotNull(signedUrl);
			Assert.Equal("http://maps.googleapis.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID&signature=KrU1TzVQM7Ur0i8i7K3huiw3MsA=", signedUrl);
		}
Ejemplo n.º 2
0
        private HttpRequestMessage BuildWebRequest(string type, string value)
        {
            string url = string.Format(ServiceUrl, type, value);

            if (BusinessKey != null)
            {
                url = BusinessKey.GenerateSignature(url);
            }

            return(new HttpRequestMessage(HttpMethod.Get, url));
        }
Ejemplo n.º 3
0
        private HttpWebRequest BuildWebRequest(string type, string value)
        {
            string url = string.Format(ServiceUrl, type, value);

            if (BusinessKey != null)
            {
                url = BusinessKey.GenerateSignature(url);
            }

            var req = WebRequest.Create(url) as HttpWebRequest;

            req.Proxy  = Proxy;
            req.Method = "GET";
            return(req);
        }