[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436703#comment-17436703
 ] 

Arturo Bernal commented on HTTPCLIENT-2065:
-------------------------------------------

HI [~michael-o]

Please take a look to the PR to see if what is what you was looking for.

TY

> 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
>            Priority: Major
>
> 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.3.4#803005)

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

Reply via email to