org.apache.http.impl.client.DefaultRedirectHandler Java Examples

The following examples show how to use org.apache.http.impl.client.DefaultRedirectHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SyncHttpClient.java    From sealtalk-android with MIT License 5 votes vote down vote up
/**
 * Simple interface method, to enable or disable redirects. If you set
 * manually RedirectHandler on underlying HttpClient, effects of this method
 * will be canceled.
 * 
 * @param enableRedirects
 *            boolean
 */
public void setEnableRedirects(final boolean enableRedirects) {
	httpClient.setRedirectHandler(new DefaultRedirectHandler() {
		@Override
		public boolean isRedirectRequested(HttpResponse response, HttpContext context) {
			return enableRedirects;
		}
	});
}
 
Example #2
Source File: AsyncHttpClient.java    From sealtalk-android with MIT License 5 votes vote down vote up
/**
 * Simple interface method, to enable or disable redirects. If you set manually RedirectHandler
 * on underlying HttpClient, effects of this method will be canceled.
 *
 * @param enableRedirects boolean
 */
public void setEnableRedirects(final boolean enableRedirects) {
    httpClient.setRedirectHandler(new DefaultRedirectHandler() {
        @Override
        public boolean isRedirectRequested(HttpResponse response, HttpContext context) {
            return enableRedirects;
        }
    });
}
 
Example #3
Source File: AsyncHttpClient.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
/**
 * Simple interface method, to enable or disable redirects. If you set manually RedirectHandler
 * on underlying HttpClient, effects of this method will be canceled.
 *
 * @param enableRedirects boolean
 */
public void setEnableRedirects(final boolean enableRedirects) {
    httpClient.setRedirectHandler(new DefaultRedirectHandler() {
        @Override
        public boolean isRedirectRequested(HttpResponse response, HttpContext context) {
            return enableRedirects;
        }
    });
}