2017년 6월 12일 월요일

3. JAVA로 날씨정보, 대기정보 호출...

1. 대기정보값 받기..


public static void getAir(String lat, String lon){
  httpclient = HttpClients.createDefault();
  String callUrl = setLocation(lat, lon, "air");
  try {
   HttpGet httpGet = new HttpGet(callUrl);     //대기정보 url 호출...
   httpGet.addHeader("appKey", appKeyId);
   System.out.println(httpGet.getURI());
   System.out.println("[Executing request]: " + httpGet.getRequestLine());

   HttpResponse response = httpclient.execute(httpGet);

   //System.out.println(response.toString());
   InputStream in2;
   in2 = response.getEntity().getContent();
   printByInputStream(in2 , "air");
   in2.close();
  } catch (ClientProtocolException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } finally {
   
  }
 }

댓글 없음:

댓글 쓰기

[DOS] ULTIMA 2 클리어

  몰아쓰는 거라.. 포스팅을 또 함.. ​ 울티마를 하려면.. 일단 메뉴얼부터 정독을 하고 뭘해야 할 지를 정한다음 게임을 해야 한다.. ​ 2편 메뉴얼을 보니.. 형편없는 쓰레기게임이구나.. 라는 생각만 든다.. ​ 낭만의 시대적 게임이라.. 정말...