Add payload and headers for upload.

When the server requires a CSRF token, we need to put it in the body or header.