I'm trying to send a POST to the Smarty Streets API, but the response I'm getting back is a malformed payload. I went through the documentation on the site and I think I have everything formed correctly to send. I even used Fiddler to see what I"m sending and it looks correct but there must be something I"m missing. I'm relatively new programming. So any help would be appreciated.
string url = Uri.EscapeUriString("http://api.smartystreets.com/street-address?auth-id=Id&auth-token=token");
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
TestAddress json = new TestAddress();
json.street = "11 Phelan Ave, San Francisco, CA";
string jsoncvt = JsonConvert.SerializeObject(json);
byte[] byteArray = Encoding.UTF8.GetBytes(jsoncvt);
httpWebRequest.ContentLength = byteArray.Length;
httpWebRequest.Host = "api.smartystreets.com";
httpWebRequest.ContentType = "application/json";
httpWebRequest.Accept= "application/json";
httpWebRequest.Method = "POST";
Stream dataStream = httpWebRequest.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();