merge two http.request calls in Request.submit

Request.submit may submit using MIME or URL form.
Each approach invoked http.request, and then error handling
is performed in a uniform manner.

This patch moves the invocation out of each branch, so
changes to the http request parameters can be added in one
place rather than twice.

Change-Id: I47cbf80dac5b29f6d9548481815d47140aa0c575
Merge "merge two http.request calls in Request.submit"