locked
How can i extract a value from a string ? RRS feed

  • Question

  • User1253338400 posted

    Hi 

    I a call to an api that returns the following ... 

    response = (HttpWebResponse)request.GetResponse();
    using (Stream responseStream = response.GetResponseStream())
    {
    if (responseStream != null)
    {
    using (StreamReader reader = new StreamReader(responseStream))
    {
         strResponseValue = reader.ReadToEnd();
    }
    }
    }

    Now strResponseValue  returns the following:

    {"id":"guid value here","api":"api.myapi.com"}

    How can i extract the id value ? 

    thanks

    Thursday, October 3, 2019 1:10 AM

Answers

  • User1253338400 posted

    Hi , I got it just had to deserialize the response.

    cheers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 3, 2019 1:22 AM