Thanks it worked -----Original Message----- From: Bernd Eckenfels <e...@zusammenkunft.net> Sent: Thursday, September 26, 2019 12:45 PM To: HttpClient User Discussion <httpclient-users@hc.apache.org> Subject: Re: Way to send p12 file with post payload in httpclient 4.5.4
Maybe using a ByteArrayBody or FileBody should help, since the InputStream can be consumed only once. Gruss Bernd -- http://bernd.eckenfels.net ________________________________ Von: Khare, Aparna <aparna.kh...@sap.com> Gesendet: Donnerstag, September 26, 2019 9:03 AM An: HttpClient User Discussion Betreff: Way to send p12 file with post payload in httpclient 4.5.4 Dear All, Im using the below httpclient code to send the pk12 file Input stream is the stream obtained after reading pk12 file the same file is to be send to another endpoint MultipartEntity entity = new MultipartEntity(); entity.addPart("file", new InputStreamBody(inputStream2, "test.p12")); Destination destination = getDestination(destinationName); HttpClient httpClient = destination.createHttpClient(); HttpPost httpPost = getHttpPost(destination, endPoint); httpPost.setEntity(entity); response = httpClient.execute(httpPost); However we are always getting cannot-retry-request-with-a-non-repeatable-request-entity Any Idea please help Thanks, Aparna --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org