TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ankit chourasia
NA
104
6.1k
how to Parse Json string
May 18 2019 2:30 AM
string s =
"{\"SubmitMadLabResult\":\"[{\\\"code\\\":\\\"1\\\",\\\"errorCode\\\":\\\"\\\",\\\"Message\\\":\\\"Success\\\",\\\"bStatus\\\":\\\"true\\\"}]\"}";
i have get json responce of a web service like above . how to parse this type of json.
code;-
httpRequest.ContentType = "application/json";
httpRequest.Method = "POST";
byte[] bytes = Encoding.UTF8.GetBytes(inputJson);
using (Stream stream = httpRequest.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
stream.Close();
}
string result = string.Empty;
HttpWebResponse response = null;
using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse())
{
using (Stream stream = httpResponse.GetResponseStream())
{
string StatusCode = httpResponse.StatusCode.ToString();
result = (new StreamReader(stream)).ReadToEnd();
// result= "{\"SubmitMadLabResult\":\"[{\\\"code\\\":\\\"1\\\",\\\"errorCode\\\":\\\"\\\",\\\"Message\\\":\\\"Success\\\",\\\"bStatus\\\":\\\"true\\\"}]\"}"
response = (HttpWebResponse)httpRequest.GetResponse();
}
}
Reply
Answers (
8
)
Error system.net.httpwebrequest.getresponse()
Hello Respected i am getting result always false using grid