Package org.b3log.latke.urlfetch

Examples of org.b3log.latke.urlfetch.HTTPHeader


    public String httpPost(String url, String queryString) throws Exception {
        String ret = null;
        final HTTPRequest request = new HTTPRequest();
        request.setURL(new URL(url));
        request.setRequestMethod(HTTPRequestMethod.POST);
        request.addHeader(new HTTPHeader("Content-Type",
                                         "application/x-www-form-urlencoded"));
        if (queryString != null && !queryString.equals("")) {
            request.setPayload(queryString.getBytes("UTF-8"));
        }
View Full Code Here


     * @param httpResponse HTTP Rsponse
     * @param headerFields headerFiedls in HTTP response
     */
    protected void fillHttpResponseHeader(final HTTPResponse httpResponse, final Map<String, List<String>> headerFields) {
        for (Map.Entry<String, List<String>> entry : headerFields.entrySet()) {
            httpResponse.addHeader(new HTTPHeader(entry.getKey(), entry.getValue().toString()));
        }
    }
View Full Code Here

        ret.setFinalURL(response.getFinalUrl());
        ret.setResponseCode(response.getResponseCode());

        final List<com.google.appengine.api.urlfetch.HTTPHeader> gaeHTTPHeaders = response.getHeaders();
        for (final com.google.appengine.api.urlfetch.HTTPHeader gaeHTTPHeader : gaeHTTPHeaders) {
            final HTTPHeader header = new HTTPHeader(gaeHTTPHeader.getName(), gaeHTTPHeader.getValue());
            ret.addHeader(header);
        }

        return ret;
    }
View Full Code Here

TOP

Related Classes of org.b3log.latke.urlfetch.HTTPHeader

Copyright © 2018 www.massapicom. 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.