com.github.kevinsawicki.http.HttpRequest.setProperty()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(137)

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

HttpRequest.setProperty介绍

[英]Set property to given value.

Specifying a null value will cause the property to be cleared
[中]

代码示例

代码示例来源:origin: lkorth/httpebble-android

/**
 * Set the 'http.proxyHost' & 'https.proxyHost' properties to the given host
 * value.
 * <p/>
 * This setting will apply to requests.
 *
 * @param host
 */
public static void proxyHost(final String host) {
  setProperty("http.proxyHost", host);
  setProperty("https.proxyHost", host);
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Set the 'http.proxyHost' and 'https.proxyHost' properties to the given host
 * value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param host
 */
public static void proxyHost(final String host) {
  setProperty("http.proxyHost", host);
  setProperty("https.proxyHost", host);
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Set the 'http.proxyHost' and 'https.proxyHost' properties to the given host
 * value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param host
 */
public static void proxyHost(final String host) {
 setProperty("http.proxyHost", host);
 setProperty("https.proxyHost", host);
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Set the 'http.proxyHost' & 'https.proxyHost' properties to the given host
 * value.
 * <p>
 * This setting will apply to requests.
 *
 * @param host
 */
public static void proxyHost(final String host) {
 setProperty("http.proxyHost", host);
 setProperty("https.proxyHost", host);
}

代码示例来源:origin: lkorth/httpebble-android

/**
 * Set the 'http.proxyPort' & 'https.proxyPort' properties to the given port
 * number.
 * <p/>
 * This setting will apply to requests.
 *
 * @param port
 */
public static void proxyPort(final int port) {
  final String portValue = Integer.toString(port);
  setProperty("http.proxyPort", portValue);
  setProperty("https.proxyPort", portValue);
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Set the 'http.proxyPort' and 'https.proxyPort' properties to the given port
 * number.
 * <p>
 * This setting will apply to all requests.
 *
 * @param port
 */
public static void proxyPort(final int port) {
  final String portValue = Integer.toString(port);
  setProperty("http.proxyPort", portValue);
  setProperty("https.proxyPort", portValue);
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Set the 'http.proxyPort' & 'https.proxyPort' properties to the given port
 * number.
 * <p>
 * This setting will apply to requests.
 *
 * @param port
 */
public static void proxyPort(final int port) {
 final String portValue = Integer.toString(port);
 setProperty("http.proxyPort", portValue);
 setProperty("https.proxyPort", portValue);
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Set the 'http.proxyPort' and 'https.proxyPort' properties to the given port
 * number.
 * <p>
 * This setting will apply to all requests.
 *
 * @param port
 */
public static void proxyPort(final int port) {
 final String portValue = Integer.toString(port);
 setProperty("http.proxyPort", portValue);
 setProperty("https.proxyPort", portValue);
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Set the 'http.keepAlive' property to the given value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param keepAlive
 */
public static void keepAlive(final boolean keepAlive) {
 setProperty("http.keepAlive", Boolean.toString(keepAlive));
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Set the 'http.maxConnections' property to the given value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param maxConnections
 */
public static void maxConnections(final int maxConnections) {
 setProperty("http.maxConnections", Integer.toString(maxConnections));
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Set the 'http.keepAlive' property to the given value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param keepAlive
 */
public static void keepAlive(final boolean keepAlive) {
  setProperty("http.keepAlive", Boolean.toString(keepAlive));
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Set the 'http.keepAlive' property to the given value.
 * <p>
 * This setting will apply to requests.
 *
 * @param keepAlive
 */
public static void keepAlive(final boolean keepAlive) {
 setProperty("http.keepAlive", Boolean.toString(keepAlive));
}

代码示例来源:origin: lkorth/httpebble-android

/**
 * Set the 'http.keepAlive' property to the given value.
 * <p/>
 * This setting will apply to requests.
 *
 * @param keepAlive
 */
public static void keepAlive(final boolean keepAlive) {
  setProperty("http.keepAlive", Boolean.toString(keepAlive));
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Set the 'http.maxConnections' property to the given value.
 * <p>
 * This setting will apply to all requests.
 *
 * @param maxConnections
 */
public static void maxConnections(final int maxConnections) {
  setProperty("http.maxConnections", Integer.toString(maxConnections));
}

代码示例来源:origin: lkorth/httpebble-android

/**
 * Set the 'http.nonProxyHosts' property to the given host values.
 * <p/>
 * Hosts will be separated by a '|' character.
 * <p/>
 * This setting will apply to requests.
 *
 * @param hosts
 */
public static void nonProxyHosts(final String... hosts) {
  if (hosts != null && hosts.length > 0) {
    StringBuilder separated = new StringBuilder();
    int last = hosts.length - 1;
    for (int i = 0; i < last; i++)
      separated.append(hosts[i]).append('|');
    separated.append(hosts[last]);
    setProperty("http.nonProxyHosts", separated.toString());
  } else
    setProperty("http.nonProxyHosts", null);
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Set the 'http.nonProxyHosts' property to the given host values.
 * <p>
 * Hosts will be separated by a '|' character.
 * <p>
 * This setting will apply to all requests.
 *
 * @param hosts
 */
public static void nonProxyHosts(final String... hosts) {
 if (hosts != null && hosts.length > 0) {
  StringBuilder separated = new StringBuilder();
  int last = hosts.length - 1;
  for (int i = 0; i < last; i++)
   separated.append(hosts[i]).append('|');
  separated.append(hosts[last]);
  setProperty("http.nonProxyHosts", separated.toString());
 } else
  setProperty("http.nonProxyHosts", null);
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Set the 'http.nonProxyHosts' property to the given host values.
 * <p>
 * Hosts will be separated by a '|' character.
 * <p>
 * This setting will apply to all requests.
 *
 * @param hosts
 */
public static void nonProxyHosts(final String... hosts) {
  if (hosts != null && hosts.length > 0) {
    StringBuilder separated = new StringBuilder();
    int last = hosts.length - 1;
    for (int i = 0; i < last; i++)
      separated.append(hosts[i]).append('|');
    separated.append(hosts[last]);
    setProperty("http.nonProxyHosts", separated.toString());
  } else
    setProperty("http.nonProxyHosts", null);
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Set the 'http.nonProxyHosts' property to the given host values.
 * <p>
 * Hosts will be separated by a '|' character.
 * <p>
 * This setting will apply to requests.
 *
 * @param hosts
 */
public static void nonProxyHosts(final String... hosts) {
 if (hosts != null && hosts.length > 0) {
  StringBuilder separated = new StringBuilder();
  int last = hosts.length - 1;
  for (int i = 0; i < last; i++)
   separated.append(hosts[i]).append('|');
  separated.append(hosts[last]);
  setProperty("http.nonProxyHosts", separated.toString());
 } else
  setProperty("http.nonProxyHosts", null);
}

相关文章

HttpRequest类方法