So the the api was accepting one string parameter so i did this
System.Text.Encoding encoding = System.Text.Encoding::UTF8;
System.Byte[] byteArray = encoding.GetBytes(_data); //_data is string
_request.set_ContentLength(byteArray.get_Length());
using(System.IO.Stream dataStream = _request.GetRequestStream())
{
dataStream.Write(byteArray, 0, byteArray.get_Length());
}
Now the api accepts two paramters in the body
So i made an object class that contains two fields str dataString and int dataId and i need to pass these two values to the body
i think i should repalce getBytes(_data) with getBytes(object.dataString) but how can i pass dataId as well?
So in postman it works if i write in the body
{
"dataString": kfsifks,
"dataId":1
}