Пример #1
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        //ORIGINAL LINE: private java.io.InputStream getInputStream(String paramString, java.util.Map<String, String> paramMap) throws Exception
        private Stream getInputStream(string paramString, IDictionary <string, string> paramMap)
        {
            URL uRL = constructURL(paramString, paramMap);
            HttpURLConnection httpURLConnection = (HttpURLConnection)uRL.openConnection();

            httpURLConnection.ConnectTimeout = 4000;
            httpURLConnection.ReadTimeout    = 30000;
            if (((!string.ReferenceEquals(this.username, null)) ? 1 : 0) & ((!string.ReferenceEquals(this.password, null)) ? 1 : 0))
            {
                httpURLConnection.setRequestProperty("Authorization", "Basic " + HTTPUtil.encode(this.username + ":" + this.password));
            }
            httpURLConnection.setRequestProperty("Content-Type", "application/json");
            return(httpURLConnection.InputStream);
        }