Android BasicHttpProcessor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BasicHttpProcessor class.

This code example shows how to use the following methods:addInterceptor
This code example shows how to use the following methods:addInterceptor
            .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
            .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false)
            .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
            .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");
 
        BasicHttpProcessor httpproc = new BasicHttpProcessor();
        httpproc.addInterceptor(new ResponseDate());
        httpproc.addInterceptor(new ResponseServer());
        httpproc.addInterceptor(new ResponseContent());
        httpproc.addInterceptor(new ResponseConnControl());
 
        BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(
                httpproc,
                new DefaultHttpResponseFactory(),
                new DefaultConnectionReuseStrategy(),
                params);
 
        // Set up request handlers 
        HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
        registry.register("/process", new SynthesisRequestHandler());
5
CodeRank
This code example shows how to use the following methods:addInterceptor
					.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
					.setParameter(CoreProtocolPNames.ORIGIN_SERVER,
							"HttpComponents/1.1"); 
 
			// Set up the HTTP protocol processor 
			BasicHttpProcessor httpproc = new BasicHttpProcessor();
			httpproc.addInterceptor(new ResponseDate());
			httpproc.addInterceptor(new ResponseServer());
			httpproc.addInterceptor(new ResponseContent());
			httpproc.addInterceptor(new ResponseConnControl());
 
			// Set up the HTTP service 
			new HttpService(httpproc, new DefaultConnectionReuseStrategy(),
					new DefaultHttpResponseFactory());
		} 
 
		public void stopServer() { 
			try { 
				this.serversocket.close();
			} catch (IOException e) {
4
CodeRank
This code example shows how to use the following methods:addInterceptor
                .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false)
                .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
                .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");
 
            // Set up the HTTP protocol processor 
            BasicHttpProcessor httpproc = new BasicHttpProcessor();
            httpproc.addInterceptor(new ResponseDate());
            httpproc.addInterceptor(new ResponseServer());
            httpproc.addInterceptor(new ResponseContent());
            httpproc.addInterceptor(new ResponseConnControl());
             
            // Set up the HTTP service 
            new HttpService(httpproc, new DefaultConnectionReuseStrategy(),
                    new DefaultHttpResponseFactory());
        } 
         
        public void stopServer() { 
            try { 
                this.serversocket.close();
            } catch (IOException e) {
4
CodeRank
This code example shows how to use the following methods:addInterceptor
					CoreConnectionPNames.STALE_CONNECTION_CHECK, false ).setBooleanParameter(
					CoreConnectionPNames.TCP_NODELAY, true ).setParameter( CoreProtocolPNames.ORIGIN_SERVER,
					"HttpComponents/1.1" ); 
 
			// Set up the HTTP protocol processor 
			BasicHttpProcessor httpproc = new BasicHttpProcessor();
			httpproc.addInterceptor( new ResponseDate() );
			httpproc.addInterceptor( new ResponseServer() );
			httpproc.addInterceptor( new ResponseContent() );
			httpproc.addInterceptor( new ResponseConnControl() );
 
			// Set up request handlers 
			HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
			reqistry.register( "*", new HttpFileHandler( docroot ) );
 
			// Set up the HTTP service 
			this.httpService = new HttpService( httpproc, new DefaultConnectionReuseStrategy(),
					new DefaultHttpResponseFactory() );
			this.httpService.setParams( this.params );
			this.httpService.setHandlerResolver( reqistry );
4
CodeRank
This code example shows how to use the following methods:addInterceptor
This code example shows how to use the following methods:addInterceptor
					CoreConnectionPNames.STALE_CONNECTION_CHECK, false ).setBooleanParameter(
					CoreConnectionPNames.TCP_NODELAY, true ).setParameter( CoreProtocolPNames.ORIGIN_SERVER,
					"HttpComponents/1.1" ); 
 
			// Set up the HTTP protocol processor 
			BasicHttpProcessor httpproc = new BasicHttpProcessor();
			httpproc.addInterceptor( new ResponseDate() );
			httpproc.addInterceptor( new ResponseServer() );
			httpproc.addInterceptor( new ResponseContent() );
			httpproc.addInterceptor( new ResponseConnControl() );
 
			// Set up request handlers 
			HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
			reqistry.register( "*", new HttpFileHandler( docroot ) );
 
			// Set up the HTTP service 
			this.httpService = new HttpService( httpproc, new DefaultConnectionReuseStrategy(),
					new DefaultHttpResponseFactory() );
			this.httpService.setParams( this.params );
			this.httpService.setHandlerResolver( reqistry );
4
CodeRank
This code example shows how to use the following methods:addInterceptor, BasicHttpProcessor.addInterceptor
	 *  
	 *  
	 * @return HttpProcessor with WebManager specific clients 
	 */ 
	protected BasicHttpProcessor createHttpProcessor() {
		BasicHttpProcessor httpproc = new BasicHttpProcessor();
 
		/** 
		 * In this section, add interceptors 
		 */ 
 
		GatewayInterceptor apigeeInterceptor = new GatewayInterceptor(webManagerClientConfigLoader);
		 
		httpproc.addInterceptor(apigeeInterceptor);		
		 
		PerformanceMonitoringInterceptor performanceMonitoringInterceptor = new PerformanceMonitoringInterceptor();
 
		performanceMonitoringInterceptor
				.setMetricsCollector(this.metricsCollector);
 

5
CodeRank
This code example shows how to use the following methods:addInterceptor
This code example shows how to use the following methods:addInterceptor
See Code Examples for Android BasicHttpProcessor Methods: