rest test

it2022-05-09  29

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/archive/2013/02/20/2919222.html


最新回复(0)