Hi Stephan,
sorry for bothering you that often but I just do not get it running. I just
will exlain my problem a bit more in detail. While sending GET request
everything concerning a simple GET request works. But sending a request with
any other method I always get the 405 status code, even I do just a normal
POST request with a normal POST parameter. Let me explain it with a small
example.
My Jax-Rs resource looks like:
...
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.UriInfo;
@Path("blogs")
public class BlogResource extends {
...
@POST
public String createBlog(@Context UriInfo info) {
....
return "{\"result\":\"ok\"}"
}
...
}
My HTML file looks like:
<html><head><title>REST Web test client</title></head>
<body>
<form name="restrequest" action="http://localhost:8182/blogs/blogs"
target="right" method="POST">
<input type="text" value="me" name="tags">
<input type="submit" value="Submit" />
</form>
</body>
</html>
So it should call the POST method with a POST parameter tags=me. But the server
just returns a 405. And when I enable the method tunneling the server logs just
that POST is called with a POST parameter method=DELETE but that the POST
request is not allowed and returns a 405.
To sum it up, I am not able to process a POST request either with nor without a
parameter. Do I have to allow POST somehow?
> Hi Matthias,
> > as I read parts of your master thesis I found the extension issue and that
> > it was done on purpose. So I could have found it by my own. Sorry for
> > bothering you with this.
> > But I got another issue, sending parameter with a POST request. When I send
> > parameter with a POST request I just get an "405 - Method not allowed". I
> > searched the internet and found that you have to enable the different
> > methods woth allowPost(). But to do so you have to use Restlet resources
> > from the Restlet version 1.1. But I don't use Restlet 1.1 (did not found
> > such a method for 2.1) and I don't have use Restlet resources at all.
> >
> > Do I have to enable the POST methods somehow? (sending a POST request
> > without POST parameter works)
> In the JAX-RS extension not.
> allowPost() is for pure Restlet 1.x.
>
> Do you have the problems with post, if you add parameters for the tunnel
> filter? Maybe the tunnel filter only works on GET requests.
>
> best regards
> Stephan
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2666931