What's the difference between org.springframework.http.httpRequest and httpServletRequest?

beginners of Java and spring boot, recently want to be interceptors of resttemplate, and found methods in interceptors

ClientHttpResponse intercept (HttpRequest request, byte [] body, ClientHttpRequestExecution execution)

The

parameter is the request information of the httpRequest, project in actual combat. Generally, the two methods of javax.servlet.http.httpservletRequest
are also different. The HttpServlet object can only be indexed by the header name, and the getheaders of HttpRequest returns the complete HttpHeader object, and the method makes it clear that the return value is not empty.

/**
 * Return the headers of this message.
 * @return a corresponding HttpHeaders object (never {@code null})
 */
HttpHeaders getHeaders();

this is also a bit confusing. What do you get if you build a request,httpRequest with header as null through HttpEntity request = new HttpEntity < > (body, headers);?

what are the connections and differences between the two? I have already googled and failed to find a suitable answer. Thank you

May.06,2021

use HttpServletRequest because you use Servlet
instead of RestTemplate you can only use HttpRequest because RestTemplate is an abstraction made by spring itself, and of course you can only use your own things

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e96ec6-5c431.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e96ec6-5c431.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?