gpt4 book ai didi

org.apache.xmlrpc.client.XmlRpcHttpTransport类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 04:45:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.xmlrpc.client.XmlRpcHttpTransport类的一些代码示例,展示了XmlRpcHttpTransport类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlRpcHttpTransport类的具体详情如下:
包路径:org.apache.xmlrpc.client.XmlRpcHttpTransport
类名称:XmlRpcHttpTransport

XmlRpcHttpTransport介绍

[英]Abstract base implementation of an HTTP transport. Base class for the concrete implementations, like org.apache.xmlrpc.client.XmlRpcSunHttpTransport, or org.apache.xmlrpc.client.XmlRpcCommonsTransport.
[中]HTTP传输的抽象基实现。具体实现的基类,比如org。阿帕奇。xmlrpc。客户XmlRpcSunHttpTransport,或org。阿帕奇。xmlrpc。客户XmlRpcCommonsTransport。

代码示例

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  initHttpHeaders(pRequest);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException {
  XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  setRequestHeader("Content-Type", "text/xml");
  setRequestHeader("User-Agent", getUserAgent());
  setCredentials(config);
  setCompressionHeaders(config);
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) {
  boolean result = super.isUsingByteArrayOutput(pConfig);
  if (!result) {
    throw new IllegalStateException("The Content-Length header is required with HTTP/1.0, and HTTP/1.1 is unsupported by the Lite HTTP Transport.");
  }
  return result;
}

代码示例来源:origin: rosjava/rosjava_core

protected ReqWriter newReqWriter(XmlRpcRequest pRequest)
      throws XmlRpcException, IOException, SAXException {
    final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
    if (isUsingByteArrayOutput(config)) {
      ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest);
      setContentLength(reqWriter.getContentLength());
      if (isCompressingRequest(config)) {
        return new GzipReqWriter(reqWriter);
      }
      return reqWriter;
    } else {
      return super.newReqWriter(pRequest);
    }
  }
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected void setContentLength(int pLength) {
  setRequestHeader("Content-Length", Integer.toString(pLength));
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected ReqWriter newReqWriter(XmlRpcRequest pRequest)
      throws XmlRpcException, IOException, SAXException {
    final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
    if (isUsingByteArrayOutput(config)) {
      ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest);
      setContentLength(reqWriter.getContentLength());
      if (isCompressingRequest(config)) {
        return new GzipReqWriter(reqWriter);
      }
      return reqWriter;
    } else {
      return super.newReqWriter(pRequest);
    }
  }
}

代码示例来源:origin: xmlrpc/xmlrpc-client

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  URL url = config.getServerURL();
  hostname = url.getHost();
  int p = url.getPort();
  port = p < 1 ? 80 : p;
  String u = url.getFile();
  uri = (u == null  ||  "".equals(u)) ? "/" : u;
  host = port == 80 ? hostname : hostname + ":" + port;
  headers.put("Host", host);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected ReqWriter newReqWriter(XmlRpcRequest pRequest)
      throws XmlRpcException, IOException, SAXException {
    final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
    if (isUsingByteArrayOutput(config)) {
      ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest);
      setContentLength(reqWriter.getContentLength());
      if (isCompressingRequest(config)) {
        return new GzipReqWriter(reqWriter);
      }
      return reqWriter;
    } else {
      return super.newReqWriter(pRequest);
    }
  }
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client

protected void setContentLength(int pLength) {
  setRequestHeader("Content-Length", Integer.toString(pLength));
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  URL url = config.getServerURL();
  ssl = "https".equals(url.getProtocol());
  hostname = url.getHost();
  int p = url.getPort();
  port = p < 1 ? 80 : p;
  String u = url.getFile();
  uri = (u == null  ||  "".equals(u)) ? "/" : u;
  host = port == 80 ? hostname : hostname + ":" + port;
  headers.put("Host", host);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client

protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException {
  XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  setRequestHeader("Content-Type", "text/xml");
  if(config.getUserAgent() != null)
    setRequestHeader("User-Agent", config.getUserAgent());
  else
    setRequestHeader("User-Agent", getUserAgent());
  setCredentials(config);
  setCompressionHeaders(config);
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client

protected ReqWriter newReqWriter(XmlRpcRequest pRequest)
      throws XmlRpcException, IOException, SAXException {
    final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
    if (isUsingByteArrayOutput(config)) {
      ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest);
      setContentLength(reqWriter.getContentLength());
      if (isCompressingRequest(config)) {
        return new GzipReqWriter(reqWriter);
      }
      return reqWriter;
    } else {
      return super.newReqWriter(pRequest);
    }
  }
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  initHttpHeaders(pRequest);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: rosjava/rosjava_core

protected void setContentLength(int pLength) {
  setRequestHeader("Content-Length", Integer.toString(pLength));
}

代码示例来源:origin: rosjava/rosjava_core

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  URL url = config.getServerURL();
  ssl = "https".equals(url.getProtocol());
  hostname = url.getHost();
  int p = url.getPort();
  port = p < 1 ? 80 : p;
  String u = url.getFile();
  uri = (u == null  ||  "".equals(u)) ? "/" : u;
  host = port == 80 ? hostname : hostname + ":" + port;
  headers.put("Host", host);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: rosjava/rosjava_core

protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) {
  boolean result = super.isUsingByteArrayOutput(pConfig);
  if (!result) {
    throw new IllegalStateException("The Content-Length header is required with HTTP/1.0, and HTTP/1.1 is unsupported by the Lite HTTP Transport.");
  }
  return result;
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException {
  XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  setRequestHeader("Content-Type", "text/xml");
  if(config.getUserAgent() != null)
    setRequestHeader("User-Agent", config.getUserAgent());
  else
    setRequestHeader("User-Agent", getUserAgent());
  setCredentials(config);
  setCompressionHeaders(config);
}

代码示例来源:origin: rosjava/rosjava_core

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  initHttpHeaders(pRequest);
  return super.sendRequest(pRequest);
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected void setContentLength(int pLength) {
  setRequestHeader("Content-Length", Integer.toString(pLength));
}

代码示例来源:origin: xmlrpc/xmlrpc-client

public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
  XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig();
  try {
    conn = config.getServerURL().openConnection();
    conn.setUseCaches(false);
    conn.setDoInput(true);
    conn.setDoOutput(true);
  } catch (IOException e) {
    throw new XmlRpcException("Failed to create URLConnection: " + e.getMessage(), e);
  }
  return super.sendRequest(pRequest);
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com