moved HttpWebRequest munging prior to writing to the request