title: JSONObject["keyName"] not found exception while parsing Json data even if key is present
body: <p>I have a code which returns JSON data. I need to pick certain values from it but it throws Exception for some keys while some are successful. </p>
  
  <p>Here is the JSON data</p>
  
  <pre><code>{"value":[{"Name":"abc.txt","DateTimeLastModified":"2017-09-21T20:11:04Z","IsInline":false,"ContentBytes":"some byte data","IsContactPhoto":false}]}
  </code></pre>
  
  <p>Here is how I am trying to pick the values from it</p>
  
  <pre><code>JSONObject jsonObject = response.getBody().getObject();
      JSONArray tsmresponse = (JSONArray) jsonObject.get("value");
      for(int i=0; i&lt;tsmresponse.length(); i++){
          System.out.println("Name:: "+tsmresponse.getJSONObject(i).getString("Name"));           
              }
  </code></pre>
  
  <p>The code throws Exception <strong><em>org.json.JSONException: JSONObject["Name"] not found.</em></strong> while it is able to read <strong>DateTimeLastModified</strong> value.</p>
  
  <p>Please help me to resolve this issue.</p>