Java EE put execution

Viewed 12

I am solving a task connected with servlets. Everything is in doPut method extended HttpServlet. Recommendation is called:

,,To set a variable user executes PUT request to /calc/<variable_name> URI where <variable_name> is a variable name (latin lowercase single characters) and variable value is the request body''.

I have no idea how to send above request. I tried something like but it fails

http.setEntity(new StringEntity(here variable))

HttpResponse response1 = httpclient.execute(httpPut);

In this case I get

Servlet.service() for servlet [VariablesCalculator] in context with path [] threw exception.

I will be thankful for your responses

0 Answers
Related