Package org.b3log.latke.urlfetch

Examples of org.b3log.latke.urlfetch.HTTPRequest.addHeader()


    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

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.