Methods Summary |
---|
public static java.lang.String | getContentCharset(org.apache.http.params.HttpParams params)Returns the default charset to be used for writing content body,
when no charset explicitly specified.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
String charset = (String) params.getParameter
(CoreProtocolPNames.HTTP_CONTENT_CHARSET);
if (charset == null) {
charset = HTTP.DEFAULT_CONTENT_CHARSET;
}
return charset;
|
public static java.lang.String | getHttpElementCharset(org.apache.http.params.HttpParams params)Returns the charset to be used for writing HTTP headers.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
String charset = (String) params.getParameter
(CoreProtocolPNames.HTTP_ELEMENT_CHARSET);
if (charset == null) {
charset = HTTP.DEFAULT_PROTOCOL_CHARSET;
}
return charset;
|
public static java.lang.String | getUserAgent(org.apache.http.params.HttpParams params)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return (String) params.getParameter(CoreProtocolPNames.USER_AGENT);
|
public static org.apache.http.ProtocolVersion | getVersion(org.apache.http.params.HttpParams params)Returns {@link ProtocolVersion protocol version} to be used per default.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
Object param = params.getParameter
(CoreProtocolPNames.PROTOCOL_VERSION);
if (param == null) {
return HttpVersion.HTTP_1_1;
}
return (ProtocolVersion)param;
|
public static void | setContentCharset(org.apache.http.params.HttpParams params, java.lang.String charset)Sets the default charset to be used for writing content body,
when no charset explicitly specified.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, charset);
|
public static void | setHttpElementCharset(org.apache.http.params.HttpParams params, java.lang.String charset)Sets the charset to be used for writing HTTP headers.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET, charset);
|
public static void | setUseExpectContinue(org.apache.http.params.HttpParams params, boolean b)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, b);
|
public static void | setUserAgent(org.apache.http.params.HttpParams params, java.lang.String useragent)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setParameter(CoreProtocolPNames.USER_AGENT, useragent);
|
public static void | setVersion(org.apache.http.params.HttpParams params, org.apache.http.ProtocolVersion version)Assigns the {@link ProtocolVersion protocol version} to be used by the
HTTP methods that this collection of parameters applies to.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, version);
|
public static boolean | useExpectContinue(org.apache.http.params.HttpParams params)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getBooleanParameter
(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
|