Log in or register to post comments

How to send request to vuforia api

February 22, 2019 - 8:11am #1

I'm trying to rewrite the code from Java to C #, but I can't. Maybe someone reworked stringbuilder?

Everything that i wrote it's:


class SignatureBuilder

        {

            public string tmsSignature(HttpWebRequest request, string seckretKey)

            {

                string method = request.Method;

                string ContentType = "";

                string HexDigest = "d41d8cd98f00b204e9800998ecf8427e";

                if (method.Equals("GET", StringComparison.OrdinalIgnoreCase) || method.Equals("DELETE", StringComparison.OrdinalIgnoreCase))

                { }

                else if (method.Equals("POST", StringComparison.OrdinalIgnoreCase) || method.Equals("PUT", StringComparison.OrdinalIgnoreCase))

                {

                    ContentType = "application/json";

                    //HexDigest=MD5CryptoServiceProvider.Create()

                }

                else

                { System.Console.WriteLine("Error: invalid content type passed to Sig Builder"); }

                string dateValue = request.Date.ToUniversalTime().ToString();

                string requestPath = request.RequestUri.ToString();

                string toDigest = "method + " + "\n" + " + HexDigest + " + "\n" + " + ContentType + " + "\n" + " + dateValue + " + "\n" + " + requestPath";

                string shaHashed = "";

                return "0";

            }

            public string contentMD5(HttpWebRequest request)

            {

                MemoryStream stream = new MemoryStream(Convert.ToByte(request));

                Console.WriteLine(stream.Length);

                Console.ReadLine();

                return "";

            }

        }

I just don't can understand how code feature contentMD5 in c#?

Log in or register to post comments