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

Michael Osipov closed HTTPCLIENT-2065.
--------------------------------------
    Fix Version/s: 5.2-alpha2
       Resolution: Fixed

> Simplify additon of content type parameters in MultipartEntityBuilder
> ---------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2065
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2065
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: 5.2-alpha2
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Consider I want this content type: {{multipart/related; 
> type="application/json"; 
> start="<e8f615d3-5169-42a8-88fe-e5d2a6147db4@lda-client-x>"; 
> boundary=jkEwGD2liR4fm3pYCaajTuSi116SUhmmB91VJ2_n}}
> I have to do
> {code}
> MultipartEntityBuilder eb = MultipartEntityBuilder.create();
> eb.setContentType(ContentType.create("multipart/related",
>   new BasicNameValuePair("type", "application/json"),
>   new BasicNameValuePair("start", String.format("<%s>", moduleJobCid))));
> {code}
> The easier way should be
> {code}
> MultipartEntityBuilder eb = MultipartEntityBuilder.create();
> eb.setMimeSubtype("related");
> eb.addParameter(new BasicNameValuePair(...));
> eb.addParameter(new BasicNameValuePair(...));
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to