Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 33FF011617 for ; Fri, 21 Feb 2014 01:18:34 +0000 (UTC) Received: (qmail 4003 invoked by uid 500); 21 Feb 2014 01:18:20 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 3962 invoked by uid 500); 21 Feb 2014 01:18:19 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 3949 invoked by uid 99); 21 Feb 2014 01:18:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2014 01:18:19 +0000 Date: Fri, 21 Feb 2014 01:18:19 +0000 (UTC) From: "Trevor Gulick (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HTTPCLIENT-1467) Why is MultipartEntityBuilder::addPart(FormBodyPart) private? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Trevor Gulick created HTTPCLIENT-1467: ----------------------------------------- Summary: 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 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", ""); 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