[
https://issues.apache.org/jira/browse/DEFT-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13076172#comment-13076172
]
Michele ZuccalĂ commented on DEFT-153:
--------------------------------------
> Understood thanks, but I still have questions. Bear with me. :)
No problem Johnathan, I'll try to explain better :)
>I'm still curious about passing null for "params". Why not just remove it from
>the signatrue and set the local to an
>empty Map (or null, I suppose)?
>If this constructor is specific to creating a HttpRequest suitable for
>partials, what about documenting that fact and
>then removing the QUERY_STRING_PATTERN split? If I understand, that will
>always be a split on "<>", so you
>could just set "requestPath" directly.
You are right, but I don't have created this constructor only for Partials,
because are also other classes in Deft that can switch to it
(MalFormedHttpRequest for example) and save superfluous steps
However in general, the truth is that when I develop my code, I prefer to
create 'dummy' constructor (whit all, or most, settable properties) and, when
needed, more constructors that, with less parameters, try to compute the
others. Excuse me, if my patch contains some superfluous code :)
Feel free to give me advice, and with pleasure I'll change the patch :)
Last thing:
- this is not the right place, but I think that instead of private final
fields, for optional properties, can be better to find another solution (like
deleting setters), because in this way subclassing HttpRequest is more
difficult :)
Thanks
Michele
> Problems with PUT request
> -------------------------
>
> Key: DEFT-153
> URL: https://issues.apache.org/jira/browse/DEFT-153
> Project: Deft
> Issue Type: New Feature
> Components: Core
> Assignee: Johnathan Meehan
> Fix For: 0.4.0
>
> Attachments: deft-153_preview.patch
>
>
> Hi,
> It seems that PUT requests that contain a large body are truncated.
> Temporarily, I resolved with the following workaround in the method
> HttpRequest.of ()
> if (requestLine.contains ("POST") | | requestLine.contains ("PUT")) {
> int ContentLength = Integer.parseInt (generalHeaders.get
> ("content-length"));
> if (ContentLength> body.length ()) {
> return new PartialHttpRequest (requestLine, generalHeaders,
> body);
> }
> }
> I hope it can be helpful:)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira