Uploaded image for project: 'Apache Oltu'
  1. Apache Oltu
  2. OLTU-195

URLConnectionClient PUT body content

    XMLWordPrintableJSON

    Details

      Description

      In version client-1.0.1, the URLConnectionClient class does not add any body content to a PUT request - only POST requests have the body content added.
      On line 83, there is a check to see what the request method is, and if it's post, it iwll then get the output stream and write the request's body content to it:

      URLConnectionClient.java
      if (requestMethod.equals(OAuth.HttpMethod.POST)) {
          httpURLConnection.setDoOutput(true); 
          OutputStream ost = httpURLConnection.getOutputStream(); 
          PrintWriter pw = new PrintWriter(ost); 
          pw.print(request.getBody()); 
          pw.flush(); 
          pw.close(); 
      }
      

      can this be extended, so that the check also allows PUT requests to have body content appended if there is some in the request?

      Many Thanks
      Rob

        Attachments

          Activity

            People

            • Assignee:
              jasha Jasha Joachimsthal
              Reporter:
              rwjwilson Robert Wilson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: