public ProtocolVersion getProtocolVersion() { return HttpProtocolParams.getVersion(getParams()); }
/** * Set the <i>local part</i> of the User-Agent Header String. It will be suffixed with the * global part of the User-Agent, which is handled by the corresponding * {@link HttpClientService} implementation. * * @param request the request to modify * @param userAgentString the prefix of the User-Agent string which will be suffixed with a * LMF-global part handled b< the {@link HttpClientService} implementation. */ public static void setUserAgentString(HttpRequestBase request, String userAgentString) { request.getParams().setParameter(CoreProtocolPNames.USER_AGENT, userAgentString); }
/** * Set the <i>local part</i> of the User-Agent Header String. It will be suffixed with the * global part of the User-Agent, which is handled by the corresponding * {@link HttpClientService} implementation. * * @param request the request to modify * @param userAgentString the prefix of the User-Agent string which will be suffixed with a * LMF-global part handled b< the {@link HttpClientService} implementation. */ public static void setUserAgentString(HttpRequestBase request, String userAgentString) { request.getParams().setParameter(CoreProtocolPNames.USER_AGENT, userAgentString); }
protected void setRedirectRequired(final ClientInvocation request, HttpRequestBase httpMethod) { HttpClientParams.setRedirecting(httpMethod.getParams(), true); }
/** * Configure whether redirects for this request should be handled automatically. * * @param request the request to modify * @param followRedirect <code>true</code> if redirects (HTTP response code 3xx) should be * handled automatically. */ public static void setFollowRedirect(HttpRequestBase request, boolean followRedirect) { request.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, followRedirect); }
/** * Configure whether redirects for this request should be handled automatically. * * @param request the request to modify * @param followRedirect <code>true</code> if redirects (HTTP response code 3xx) should be * handled automatically. */ public static void setFollowRedirect(HttpRequestBase request, boolean followRedirect) { request.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, followRedirect); }
@Override public ProtocolVersion getProtocolVersion() { return version != null ? version : HttpProtocolParams.getVersion(getParams()); }
protected void setRedirectNotRequired(final ClientInvocation request, HttpRequestBase httpMethod) { HttpClientParams.setRedirecting(httpMethod.getParams(), false); }
@Override public ProtocolVersion getProtocolVersion() { return version != null ? version : HttpProtocolParams.getVersion(getParams()); }
public String getSoTimeout() { return request == null ? null : "" + request.getParams().getParameter(SO_TIMEOUT); }
protected void setRedirectNotRequired(final ClientInvocation request, HttpRequestBase httpMethod) { HttpClientParams.setRedirecting(httpMethod.getParams(), false); }
public ProtocolVersion getProtocolVersion() { return HttpProtocolParams.getVersion(getParams()); }
@Override public ProtocolVersion getProtocolVersion() { return version != null ? version : HttpProtocolParams.getVersion(getParams()); }
@Override public ProtocolVersion getProtocolVersion() { return version != null ? version : HttpProtocolParams.getVersion(getParams()); }
protected void setRedirectRequired(final ClientInvocation request, HttpRequestBase httpMethod) { HttpClientParams.setRedirecting(httpMethod.getParams(), true); }
@Override public ProtocolVersion getProtocolVersion() { return version != null ? version : HttpProtocolParams.getVersion(getParams()); }
public ProtocolVersion getProtocolVersion() { return HttpProtocolParams.getVersion(getParams()); }
private HttpRequestBase createGetMethod(String serviceId, Geometry geometry) { String baseUri = getBaseUrl(); HttpRequestBase method = new HttpGet(baseUri); HttpParams params = method.getParams(); NameValuePair[] requestParameters = createRequestParameters(serviceId, geometry); for (NameValuePair requestParameter : requestParameters) { params.setParameter(requestParameter.getName(), requestParameter.getValue()); } return method; }
private <T> void contributeVirtualHost(final HttpRequestBase httpRequest, final HttpClientRequest<T> httpClientRequest) { final String virtualHost = httpClientRequest.getVirtualHost(); if (StringUtils.isNotBlank(virtualHost)) { LOG.debug("Adding Virtual Host: '%s/%d'", virtualHost, httpClientRequest.getVirtualPort()); httpRequest.getParams().setParameter(ClientPNames.VIRTUAL_HOST, new HttpHost(virtualHost, httpClientRequest.getVirtualPort())); } }
private void initRequest(HttpRequestBase request, AbstractQuery query) { request.setHeader("Accept", "application/json"); if (query.getLocale() != null) { request.setHeader("Accept-Language", query.getLocale()); } request.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, query.getTimeoutMilliseconds()); request.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, query.getTimeoutMilliseconds()); }