There are three steps to a successful multipart post.

  1. Add the header Content-type: application/x-www-form-urlencoded
  2. Encode the form data
  3. Concatenate it as if you were specifying query strings in a URL

Then just send it as the POST data.

None of this is specific to d3, but I thought I'd give my answer and some sample code, since I landed here.

Sample code:

var xhr = d3.xhr(post_url)
    .header("Content-type", "application/x-www-form-urlencoded");"arg1=" + encodeURIComponent(arg1) + "&arg2=" + encodeURIComponent(arg2),
  function(error, result) {
        throw new Error(error);;

Related Query

More Query from same tag