Allow non-string objects to be posted as data alongside files.

This should resolve #1462.