Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7194691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:25:26+00:00 2026-05-28T20:25:26+00:00

I am trying to use the latest Apache HTTP Client (v4.x) to send a

  • 0

I am trying to use the latest Apache HTTP Client (v4.x) to send a multi part POST request- the example code provided with the docs gives the following code sample (somewhat modified) to make a POST request–

        FileBody bin = new FileBody(new File(args[0]));
        StringBody comment = new StringBody("A binary file of some kind");
        MultipartEntity reqEntity = new MultipartEntity();
        reqEntity.addPart("bin", bin);
        reqEntity.addPart("comment", comment);
        httppost.setEntity(reqEntity);

What I am confused about is, if I have multiple files to be added, then in the code

   reqEntity.addPart("bin", bin);

what does the first string represent? Is it the name of the file which is being sent as part of multi part post?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:25:27+00:00Added an answer on May 28, 2026 at 8:25 pm

    Multipart Form requests can have several parts, and each part is given a name (similar to a regular form request). This name can be used on the server side to retrieve a specific part, given the name. Good details are available in RFC 2388:

        3. Definition of multipart/form-data
    
           The media-type multipart/form-data follows the rules of all multipart
           MIME data streams as outlined in [RFC 2046].  In forms, there are a
           series of fields to be supplied by the user who fills out the form.
           Each field has a name. Within a given form, the names are unique.
    
           "multipart/form-data" contains a series of parts. Each part is
           expected to contain a content-disposition header [RFC 2183] where the
           disposition type is "form-data", and where the disposition contains
           an (additional) parameter of "name", where the value of that
           parameter is the original field name in the form. For example, a part
           might contain a header:
    
                Content-Disposition: form-data; name="user"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the latest (4.0.1) Apache http core components library. However, my
I'm trying to use the latest .NET client libraries to access Version 3.0 of
Im trying to use msbuild to get the latest version of my code from
I'm trying to use the latest version of the jquery.ui.spinner.js . http://wiki.jqueryui.com/w/page/12138077/Spinner The spinners
I am trying to use the TFS API to retrieve the latest code from
Trying to use virutalenv version 1.6.4 (the latest at writing this post) on 10.7,
I have been trying to use the latest NAnt (0.86 Beta 1) for a
I'm currently trying to use the latest stable fmod ex in my project. I
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying to use jQuery (latest version) & ajax to poll a mysql

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.