상세 컨텐츠

본문 제목

Apache Http Client 5

서블릿

by e7e 2022. 8. 31. 06:45

본문

https://hc.apache.org/httpcomponents-client-5.1.x/quickstart.html

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	  String bbb = URLEncoder.encode("김다미","utf-8");
	  String aaa = Request.get("https://news.google.com/rss/search?q="+ bbb+ "&hl=ko&gl=KR&ceid=KR:ko").execute().returnContent().asString();
	  response.setCharacterEncoding("utf-8");
	  response.getWriter().write(aaa);
}

 

 

'서블릿' 카테고리의 다른 글

java mail util  (0) 2022.09.23

관련글 더보기