[
https://issues.apache.org/jira/browse/HTTPCLIENT-2065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17443261#comment-17443261
]
ASF subversion and git services commented on HTTPCLIENT-2065:
-------------------------------------------------------------
Commit d2c59fd5e40409248b4c9eb876d67249ac881a1d in httpcomponents-client's
branch refs/heads/master from Arturo Bernal
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=d2c59fd ]
HTTPCLIENT-2065: Simplify additon of content type parameters in
MultipartEntityBuilder
This closes #320
> 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
> Time Spent: 1h 20m
> 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]