Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.SystemDefaultHttpClient.execute()


            if ( acceptHeader != null )
                httpget.addHeader(HttpNames.hAccept, acceptHeader) ;
           
            // Execute
            HttpClient httpclient = new SystemDefaultHttpClient();
            HttpResponse response = httpclient.execute(httpget) ;
            // Handle response
            httpResponse(id, response, baseIRI, handlers) ;
            httpclient.getConnectionManager().shutdown();
        } catch (IOException ex) { IO.exception(ex) ; }
    }
View Full Code Here


            if ( acceptHeader != null )
                httpget.addHeader(HttpNames.hAccept, acceptHeader) ;
           
            // Execute
            HttpClient httpclient = new SystemDefaultHttpClient();        // Pool?
            HttpResponse response = httpclient.execute(httpget) ;
           
            // Response
            StatusLine statusLine = response.getStatusLine() ;
            if ( statusLine.getStatusCode() == 404 )
            {
View Full Code Here

    public static String execHttpGet(String url)
    {
        HttpUriRequest httpGet = new HttpGet(url) ;
        HttpClient httpclient = new SystemDefaultHttpClient() ;
        try {
            HttpResponse response = httpclient.execute(httpGet) ;
            int responseCode = response.getStatusLine().getStatusCode() ;
            String responseMessage = response.getStatusLine().getReasonPhrase() ;
            if ( 200 != responseCode )
                throw JenaHttpException.create(responseCode, responseMessage) ;   
            HttpEntity entity = response.getEntity() ;
View Full Code Here

                log.debug(format("[%d] No content type")) ;

            // Execute
            HttpClient httpclient = new SystemDefaultHttpClient();
            httppost.setEntity(provider) ;
            HttpResponse response = httpclient.execute(httppost, context) ;
            httpResponse(id, response, baseIRI, handlers) ;
           
            httpclient.getConnectionManager().shutdown();
        } catch (IOException ex) { IO.exception(ex) ; }
        finally { closeEntity(provider) ; }
View Full Code Here

            httppost.setEntity(convertFormParams(params));
            if ( log.isDebugEnabled() )
                log.debug(format("[%d] %s %s",id ,httppost.getMethod(),httppost.getURI().toString())) ;

            HttpClient httpclient = new SystemDefaultHttpClient();
            HttpResponse response = httpclient.execute(httppost, httpContext) ;
            httpResponse(id, response, baseIRI, handlers) ;
            httpclient.getConnectionManager().shutdown();
        } catch (IOException ex) { IO.exception(ex) ; }
    }
   
View Full Code Here

            if ( log.isDebugEnabled() )
                log.debug(format("[%d] %s %s",id , httpput.getMethod(), httpput.getURI().toString())) ;
           
            httpput.setEntity(entity) ;
            HttpClient httpclient = new SystemDefaultHttpClient();
            HttpResponse response = httpclient.execute(httpput) ;
            httpResponse(id, response, baseIRI, null) ;
            httpclient.getConnectionManager().shutdown();
        } catch (IOException ex) { IO.exception(ex) ; }
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.