0

Ok so i'm using JDBC Servlet that handles incoming http requests by parsing the json, providing content to corresponding DAO which in turn updates database. After successful db update, the servlet is supposed to send said http request to another server which listens using Java's HttpServer class. My question is, is there a proper procedure to send an http request from a servlet to a different server?

user207421
  • 289,834
  • 37
  • 266
  • 440
elbud
  • 1
  • With `URLConnection` or any of the numerous HTTP client libraries. – user207421 Jan 12 '20 at 03:10
  • Don't write servlets; it's like programming in C. Use Spring, Micronaut, or another framework that handles the plumbing for you. Spring RestTemplate and Micronaut Client are two of the many convenient libraries for making HTTP requests from within your business code. – chrylis -cautiouslyoptimistic- Jan 12 '20 at 03:22

0 Answers0