title: REST services - testing PUT methods in the browser
body: <p>I've developed REST services. I can test the GET methods by the browser, or by a Client Application. But those who have PUT methods I don't know how to consume them by the browser...</p>
  
  <p>For example, I have this method that turns a lamp on, after I insert the userId:</p>
  
  <pre><code>@PUT
  @Path("/lampon")
  @Produces({"application/json", "text/plain"})
  @Consumes("multipart/form-data")
  public boolean turnOnLamp(@FormParam("userId") String userId) throws Exception
  {
      boolean response = new LampManager().turnOnLamp(userId);
      return response;
  }
  </code></pre>
  
  <p>In my client application I do this, and it works:</p>
  
  <pre><code>    String webPage = "http://localhost:8080/BliveServices/webresources/services.actuators/lampon";
  
      URL urlToRequest = new URL(webPage);
  
      //Authentication
  
      urlConnection = (HttpURLConnection) urlToRequest.openConnection();
      urlConnection.setReadTimeout(10000);
      urlConnection.setConnectTimeout(15000);
      urlConnection.setRequestMethod("PUT");
      urlConnection.setRequestProperty("Authorization", basicAuth);
      urlConnection.setRequestProperty("Content-type", "multipart/form-data");
      urlConnection.setRequestProperty("Accept", "application/json");
      urlConnection.setDoOutput(true);
      urlConnection.setDoInput(true);
  
      List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
      nameValuePairs.add(new BasicNameValuePair("userId", "2"));
  
      (...)
  </code></pre>
  
  <p><strong>But how can I send the userId by the browser?</strong></p>
  
  <p>Another thing, I get this message when I build my project:</p>
  
  <pre><code>SEVERE: Resource methods utilizing @FormParam and consuming "multipart/form-data" are no longer supported. See @FormDataParam.
  </code></pre>
  
  <p>Thanks</p>