You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Arturo Bernal (Jira)" <ji...@apache.org> on 2021/11/01 08:52:00 UTC
[jira] [Commented] (HTTPCLIENT-2065) Simplify additon of content
type parameters in MultipartEntityBuilder
[ 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="<e8...@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-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org