Restful接口的调用,前端一般使用ajax调用,后端可以使用的方法如下:

 

    1.HttpURLConnection实现

 

    2.HttpClient实现

 

    3.Spring的RestTemplate