java - How to make Apache Tomcat accept DELETE method -


i'm working on project of restful web services, i'm using apache tomcat , jax-rs.

i want accept delete requests client whenever send delete request advanced rest client chrome plugin gives response code 403 forbidden.

so how can make apche tomcat accept delete request?

tomcat blocking delete methods me because of cors filters.

i needed new filters registered in web.xml file. here's example of permissive one:

<filter>     <filter-name>corsfilter</filter-name>     <filter-class>org.apache.catalina.filters.corsfilter</filter-class>     <init-param>         <param-name>cors.allowed.headers</param-name>         <param-value>accept,accept-encoding,accept-language,access-control-request-method,access-control-request-headers,authorization,connection,content-type,host,origin,referer,token-id,user-agent, x-requested-with</param-value>     </init-param>     <init-param>         <param-name>cors.allowed.origins</param-name>         <param-value>*</param-value>     </init-param>     <init-param>         <param-name>cors.allowed.methods</param-name>         <param-value>get, post, put, delete, options, head</param-value>     </init-param> </filter> <filter-mapping>     <filter-name>corsfilter</filter-name>     <url-pattern>/*</url-pattern> </filter-mapping> 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -