How do i read the data which i pass in a POST or PUT method using -d option in curl
curl -XPUT host:port/service -d 'some data'
Is there an annotation similat to like @QueryParam for query parameters?
Jersey is Sun's production quality reference implementation for JSR 311: JAX-RS: The Java API for RESTful Web Services. Jersey implements support for the annotations defined in JSR-311, making it easy for developers to build RESTful web services with Java and the Java JVM.
JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation. Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides its own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.
This works for me. There is no need for any annotations.
WebService
@POST
@Path("/foo")
public void foo(String data) {
System.out.println(data);
}
Output
some data
Similar:
How do I read POST parameters for a RESTful service using Jersey?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With