title: How to get json data in REST endpoint C#
body: <p>i set the Transaction response callback url of an API to : <a href="https://requestb.in/st4fz3st" rel="nofollow noreferrer">https://requestb.in/st4fz3st</a> and it gives me a response ok, on debugging the response process by checking the link <a href="https://requestb.in/st4fz3st?inspect" rel="nofollow noreferrer">https://requestb.in/st4fz3st?inspect</a> the results shown in the image below.
  <a href="https://i.stack.imgur.com/IlAPf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IlAPf.png" alt="enter image description here"></a></p>
  
  <p>i want to get the json data so i wrote this c# code</p>
  
  <pre><code>string GET(string url)
  {
      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
      try
      {
          WebResponse response = request.GetResponse();
          using (Stream responseStream = response.GetResponseStream())
          {
              StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
              return reader.ReadToEnd();
          }
      }
      catch (WebException ex)
      {
          WebResponse errorResponse = ex.Response;
          using (Stream responseStream = errorResponse.GetResponseStream())
          {
              StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("utf-8"));
              String errorText = reader.ReadToEnd();
              return errorText;
          }
          throw;
      }
  }
    protected void Page_Load(object sender, EventArgs e)
  {
      x = GET(" https://requestb.in/st4fz3st");
      Response.Write(x);
  }
  </code></pre>
  
  <p>But what i get is the ok not the RAW BODY which is marked in red.</p>