Package net.yacy.cora.protocol.http

Examples of net.yacy.cora.protocol.http.HTTPClient.GETbytes()


        final HTTPClient client = new HTTPClient();
        client.setHeader(reqHeader.entrySet());
        byte[] content = null;
        try {
            // send request
          content = client.GETbytes(seedURL);
        } catch (final Exception e) {
          throw new IOException("Unable to download seed file '" + seedURL + "'. " + e.getMessage());
        }

        // check response code
View Full Code Here


        if (isHTTP() || isHTTPS()) {
                final HTTPClient client = new HTTPClient();
                client.setTimout(timeout);
                client.setUserAgent(userAgent);
                client.setHost(getHost());
                return new ByteArrayInputStream(client.GETbytes(this));
        }

        return null;
    }
View Full Code Here

        if (isHTTP() || isHTTPS()) {
                final HTTPClient client = new HTTPClient();
                client.setTimout(timeout);
                client.setUserAgent(userAgent);
                client.setHost(getHost());
                return client.GETbytes(this);
        }

        return null;
    }
View Full Code Here

            if (row == null) continue;
            url = "http://" + host + ":" + port + UTF8.String(row.get(WorkTables.TABLE_API_COL_URL));
            url += "&" + WorkTables.TABLE_API_COL_APICALL_PK + "=" + UTF8.String(row.getPK());
            Log.logInfo("WorkTables", "executing url: " + url);
            try {
                client.GETbytes(url);
                l.put(url, client.getStatusCode());
            } catch (IOException e) {
                Log.logException(e);
                l.put(url, -1);
            }
View Full Code Here

        client.setRealm(realm);
        client.setTimout(120000);
        String url = "http://" + host + ":" + port + path;
        if (pk != null) url += "&" + WorkTables.TABLE_API_COL_APICALL_PK + "=" + UTF8.String(pk);
        try {
            client.GETbytes(url);
            return client.getStatusCode();
        } catch (IOException e) {
            Log.logException(e);
            return -1;
        }
View Full Code Here

              break;
            }
            result = client.POSTbytes(url, contentStream[0].getStream(), contentStream[0].getStream().available());
        }
    } else if (SolrRequest.METHOD.GET == request.getMethod()) {
        result = client.GETbytes( this._baseURL + path + ClientUtils.toQueryString( params, false ));
    } else {
        throw new SolrServerException("Unsupported method: "+request.getMethod() );
    }

      final int statusCode = client.getStatusCode();
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.