api: pass in body to NewRequestWithContext
Created by: keegancsmith
By directly passing in the body we will also get the ContentLength header set.
Minor: we avoid the extra buffer than json.NewEncoder uses, and isntead directly get the buffer from json.Marshal.