getProtocol() vs getScheme()

Both are defined in ServletRequest interface. Using these methods, the servlet programmer can know the protocol used by the client to call the servlet. They differ slightly in the output. getProtocol() returns the protocol with version and getScheme() returns protocol without version. See the output screen at the end. Let us see what Java API …

getProtocol() vs getScheme() Read More »