oltu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasha Joachimsthal (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OLTU-195) URLConnectionClient PUT body content
Date Mon, 28 Mar 2016 17:22:25 GMT

     [ https://issues.apache.org/jira/browse/OLTU-195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jasha Joachimsthal updated OLTU-195:
------------------------------------
    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:

{code:java|title=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(); 
}
{code}

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

  was:
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:

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


> URLConnectionClient PUT body content
> ------------------------------------
>
>                 Key: OLTU-195
>                 URL: https://issues.apache.org/jira/browse/OLTU-195
>             Project: Apache Oltu
>          Issue Type: Bug
>          Components: oauth2-client
>            Reporter: Robert Wilson
>            Assignee: Jasha Joachimsthal
>            Priority: Minor
>              Labels: 1.0.1, client
>             Fix For: oauth2-1.0.2
>
>
> 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:
> {code:java|title=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(); 
> }
> {code}
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message