Q:

how to convert a dropbox API v2 POST HTTP request to jQuery $.ajax? 

I'm going over the dropbox API v2 ,and unfortunately they don't yet have their JavaScript documentation live yet.  So I'm looking at the HTTP documentation, attempting to convert stuff, but I'm unfamiliar with how to translate it. 
This HTTP call is what I'm trying to put into a jQuery $.ajax() call:
POST /2/files/upload
Host: https://content.dropboxapi.com
User-Agent: api-explorer-client
Authorization: Bearer xXblahBlahRequestTokEN
Content-Type: application/octet-stream
Dropbox-API-Arg: {"path":"/newFolder/datasrc.js","mode":"add","autorename":false}

Can I just do this? 
var args = {"path":"/newFolder/datasrc.js","mode":"add","autorename":false};

$.ajax({
    type : 'POST',
    url : 'content.dropboxapi.com/2/files/upload',
    Authorization: 'Bearer xXblahBlahRequestTokEN'
    dataType: 'application/octet-stream',
    data: args.toString()
});

It doesn't work, does nothing. 

A:

Dropbox-API-Arg is a header so you want to add that as a header same as Authorization.  
$.ajax({
    type : 'POST',
    url : 'https://content.dropboxapi.com/2/files/upload',
    dataType: 'application/octet-stream',
    headers : {
        'Authorization' : 'Bearer xXblahBlahRequestTokEN',
        'Dropbox-API-Arg' : '{"path":"/newFolder/datasrc.js","mode":"add","autorename":false}'
    }
});

You should read about HTTP some more or go to the Web Development Udacity course (it's free) that has a great section on HTTP by Steve Huffman the CEO of Reddit.