You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2014/02/21 12:06:49 UTC

[jira] [Resolved] (HTTPCLIENT-1467) Why is MultipartEntityBuilder::addPart(FormBodyPart) private?

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

Oleg Kalnichevski resolved HTTPCLIENT-1467.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.4 Alpha1

For no reason. I just screwed up. 

This made has been made public in trunk. Unfortunately I cannot merge the change to 4.3.x as we usually avoid changing public APIs in GA releases.

Oleg

> Why is MultipartEntityBuilder::addPart(FormBodyPart) private?
> -------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1467
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1467
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpMime
>    Affects Versions: 4.3 Final
>            Reporter: Trevor Gulick
>            Priority: Minor
>             Fix For: 4.4 Alpha1
>
>
> I am trying to port a 4.2 Java application to use the new 4.3 MIME library. My old code added a custom field to a FormBodyPart before adding it to a MultiPartEntity via the below code. I did not see an equivalent way to add a custom field with the MultipartEntityBuilder because the MultipartEntityBuilder::addPart(FormBodyPart) method is private. How are you supposed to add a custom header field in 4.3?
> MultipartEntity entity = new MultipartEntity(HttpMultipartMode.STRICT, "foo", encoding);
> StringBody sbody = new StringBody(jsonObj.toString(), "application/json", encoding);
> FormBodyPart stringBodyPart = new FormBodyPart("root-fields", sbody);
> stringBodyPart.addField("Content-ID", "<startpart>");
> entity.addPart(stringBodyPart);



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org