java - How can I have a hashmap of form params coming in curl request in my jersey servlet? -
i making curl request like:
curl -i -x post -d "debit_user_id=/customer/mobile_number:917827448775&recipient_id=/customer/mobile_number:9988776655/recipients/mobile_number:917526337452&pintwin=1234&amount=5000¤cy=inr&customer_id=/customer/mobile_number:9988776655&agent_id=/agents/mobile_number:919987536699" http://localhost:8080/switch/apikongcall.do/transactions
and getting these parameters in jersey servlet like:
@post //@path("/transactions") @consumes("application/x-www-form-urlencoded") public void initiateposttransaction(@formparam("debit_user_id") string debit_user_id, @formparam("recipient_id") string recipient_id, @formparam("pintwin") string pintwin, @formparam("amount") string amount, @formparam("currency") string currency, @formparam("customer_id") string customer_id, @formparam("agent_id") string agent_id) {
my question there way can create hashmap these parameters dont need extract these names individually. jest need hashmap if adds new parameter later, don't need change anything. there way remove dependency in jersey.?
Comments
Post a Comment