public static String doHttpRequest(String uri, Cons options) {
    { PropertyList proplist = Stella_Object.vetOptions(options, Stella.getQuotedTree("((:METHOD :HEADERS :CONTENT) \"/HTTP\")", "/HTTP"));
      Keyword method = ((Keyword)(proplist.lookupWithDefault(Http.KWD_METHOD, Http.KWD_GET)));
      Dictionary headers = ((Dictionary)(proplist.lookup(Http.KWD_HEADERS)));
      StringWrapper content = ((StringWrapper)(proplist.lookup(Http.KWD_CONTENT)));

      if (headers != null) {
        if (!(Stella_Object.isaP(headers, StandardObject.typeSpecToBaseType(Surrogate.realTypeSpecifier(Http.SGT_HTTP_HTTP_HEADERS))))) {
          { KeyValueList httpheaders = KeyValueList.newKeyValueList();

            { Stella_Object key = null;
              Stella_Object value = null;
              DictionaryIterator iter000 = ((DictionaryIterator)(headers.allocateIterator()));

              while (iter000.nextP()) {
                key = iter000.key;
                value = iter000.value;
                httpheaders.insertAt(((StringWrapper)(key)), ((StringWrapper)(value)));
              }
            }
            headers = httpheaders;
          }
        }
      }
      { String protocol = null;
        String userInfo = null;
        String host = null;
        String port = null;
        String path = null;
        String query = null;
        String fragment = null;

        { Object [] caller_MV_returnarray = new Object[6];

          protocol = Http.decomposeInternetUrl(uri, caller_MV_returnarray);
          userInfo = ((String)(((StringWrapper)(caller_MV_returnarray[0])).wrapperValue));
          host = ((String)(((StringWrapper)(caller_MV_returnarray[1])).wrapperValue));
          port = ((String)(((StringWrapper)(caller_MV_returnarray[2])).wrapperValue));
          path = ((String)(((StringWrapper)(caller_MV_returnarray[3])).wrapperValue));
          query = ((String)(((StringWrapper)(caller_MV_returnarray[4])).wrapperValue));
          fragment = ((String)(((StringWrapper)(caller_MV_returnarray[5])).wrapperValue));
        }
        userInfo = userInfo;
        if (!(Stella.stringEqualP(protocol, "http"))) {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("do-http-request: unsupported protocol: `" + protocol + "'");
            throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
        { int theport = Http.HTTP_DEFAULT_PORT;
          String thepath = Http.composeInternetUrl("", "", "", Stella.NULL_INTEGER, path, query, fragment);

          if (!(Stella.blankStringP(port))) {
            theport = ((int)(Native.stringToInteger(port)));
          }
          if (method == Http.KWD_GET) {
            return (Http.httpGetDataToString(host, theport, thepath, ((KeyValueList)(headers))));
          }
          else if (method == Http.KWD_POST) {
            return (Http.httpPostDataToString(host, theport, thepath, ((KeyValueList)(headers)), content));
          }
          else {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print("do-http-request: unsupported method: `" + method + "'");
              throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
        }
      }
    }
  }