Unable to post to merchant API due to error saying I must provide a request body

Unless I missed it, you’re not actually writing your payload data to the HttpWebRequest body before you’re sending it.

using (Stream _reqStrm = httpWebRequest.GetRequestStream())
{
  _reqStrm.Write(postBytes, 0, postBytes.Length);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
....

Unrelated but if you can, consider HttpClient

Hth..

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top