I am trying to send use Ext.Ajax.request
method to delete some data on server. My request method looks as below :
Ext.Ajax.request({
url: '/myserver/restful/service/delete',
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
params: {
userId: 12345
}
});
On my jersey server I have written which looks like as below :
@Path("/delete")
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deleteUser(final String userId) {
System.out.println("user id = " + userId);
return Response.ok().entity("success").build();
}
This method prints out user id in following format :
user id = userId=12345
So my expected value for userId
is 12345
but it is giving me userId=12345
. As I am newbie to jersey thing, I am not able to decide what to do now.
Can anyone please tell what is going wrong?