Overriding HTTP methods
Due to security reasons, some corporate firewalls (HTTP proxies) support only the POST
and GET
methods. This restriction forces a REST API client to use only those HTTP methods that are allowed through the firewall. RESTful web API implementations can work around this restriction by letting the client override the HTTP method via the custom X-HTTP-Method-Override
HTTP header. The REST API client can specify an X-HTTP-Method-Override
request header with a string value containing either PUT
, PATCH
, or DELETE
. When the server gets the request, the server replaces the POST
method call with the method string value set for X-HTTP-Method-Override
.
JAX-RS allows you to implement this behavior via prematching javax.ws.rs.container.ContainerRequestFilter ...
Get RESTful Java Web Services - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.