How can i consume json parameter in my webservice, I can able to get the parameters using @PathParam but to get the json data as parameter have no clue what to do.
@PathParam
is used to match a part of the URL as a parameter. For example in an url of the form http:/example.com/books/{bookid}
, you can use @PathParam("bookid")
to get the id of a book to a method.
@QueryParam
is used to access key/value pairs in the query string of the URL (the part after the ?). For example in the url http:/example.com?bookid=1
, you can use @QueryParam("bookid")
to get the value of `bookid.
Both these are used when the request url contains some info regarding the parameters and you can use the data directly in your methods.
Please specify the problem in detail if this post doesn't help you.