I am developing windows phone app. In that i need to send a json string to the server in UTF8 encoded format. I follow the below mentioned method.
private void RequestStreamCallBack(IAsyncResult ar)
{
try
{
HttpWebRequest request = (HttpWebRequest)ar.AsyncState;
Stream postStream = request.EndGetRequestStream(ar);
string postData = "OPERATION_NAME=" + operationName + "&INPUT_DATA=" + inputData ;
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
postStream.Write(byteArray, 0, postData.Length);
postStream.Close();
request.BeginGetResponse(new AsyncCallback(ResponseCallback), request);
}
catch (Exception ex)
{
}
}
The inputData contains the JSON string. So far it worked perfectly. But now the json string has " " character or "+" character. When these characters are present the server is not giving expected response. i don't know what I'm missing.
Please help. Thank you.