rest test

package com.samsung.webfront.RESTClient;

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient;

public class restTest {  public static void main(String[]args) throws ClientProtocolException, IOException{   System.out.println("any one here?");   HttpClient client=new DefaultHttpClient();   HttpGet request=new HttpGet("http://109.119.20.58:8080/webfront/Flex/test.do");   HttpResponse response=client.execute(request);   BufferedReader rd=new BufferedReader (new InputStreamReader(response.getEntity().getContent()));   String line="";   while(((line=rd.readLine())!=null)){    System.out.println(line);   }  }   }

原文地址:https://www.cnblogs.com/lauraxia/p/2919222.html