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);   }  }   }

posted on 2013-02-20 18:15  lauraxia  阅读(215)  评论(0编辑  收藏  举报

导航