Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.apache.http.HttpResponse;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
    public static String getStringResponse(HttpResponse response) throws IOException {
        InputStream inStr = response.getEntity().getContent();
        BufferedReader buf = new BufferedReader(new InputStreamReader(inStr));

        StringBuilder xmlContent = new StringBuilder();
        String line;
        while ((line = buf.readLine()) != null) {
            xmlContent.append(line);
        }
        buf.close();

        return xmlContent.toString();
    }
}