Error CS1503 RRS feed

  • Question

  • Hi, Please I am new to MVC. I am working on a project.
    Each time I try to build it, it throw "Error CS1503, cannot convert from string...
    Here is my code in question:

    namespace MySaleMVC
        public static class GlobalVariables
            public static HttpClient WebApiClient = new HttpClient();

            static GlobalVariables()
                WebApiClient.BaseAddress = new FormUrlEncodedContent("http://localhost:52859/api/");
                WebApiClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

    Please help me correct the error and let me move on.

    Thanks in Advance

    John MC

    Monday, October 28, 2019 7:42 PM


All replies