Пример #1
0
        public Client(string description_url, Dictionary <String, String> cookies = null, Dictionary <String, String> headers = null)
        {
            if (cookies == null)
            {
                m_cookieList = new Dictionary <string, string>();
            }
            else
            {
                m_cookieList = cookies;
            }

            if (headers == null)
            {
                m_headerList = new Dictionary <string, string>();
            }
            else
            {
                m_headerList = headers;
            }

            m_description_url = description_url;
            string content_type = "application/json; charset=utf-8";

            JsonWsp.Response resp = SendRequest(description_url, "", content_type, m_cookieList, m_headerList);
            if (resp.GetJsonWspType() == JsonWsp.Response.JsonWspType.Description)
            {
                JsonObject json_response = (JsonObject)JsonConvert.Import(resp.GetResponseText());
                m_service_url = (string)json_response["url"];
                m_service_url_from_description = m_service_url;
            }
        }
Пример #2
0
 public Client(string description_url)
 {
     m_description_url = description_url;
     JsonWsp.Response resp = SendRequest(description_url);
     if (resp.GetJsonWspType() == JsonWsp.Response.JsonWspType.Description)
     {
         JsonObject json_response = (JsonObject)JsonConvert.Import(resp.GetResponseText());
         m_service_url = (string)json_response["url"];
         m_service_url_from_description = m_service_url;
     }
 }