I am trying to pass the below string as parameter in Web API POST
devKey=test&sessionId=!bUUfUjXzPX&data={"nested": true,"start" : 2,"max" : 999}
But I am unable to convert it to Byte array, it throws the following error:
Throwing 'Input string was not in a correct format.' error due to {}
Can you please suggest a way to convert or to POST(HttpWebRequest) in any other way.
I tried the code below, and I used a similar method before, but those strings didn't consists of {} and worked fine.
string strNewValue = "devKey=" + _devKey + "&userName=" + _uName + "&password=" + _pwd;
byte[] byteArray = Encoding.UTF8.GetBytes(string.Format(strNewValue));
string.Format()seems to be there for no reason, and currently causing the issue.