title: Parse json body array sent in POST request and print
body: <p>I am having one issue while reading the json array. Need help for below query.</p>
  <p>Request Json :</p>
  <pre><code>{ &quot;httpReq&quot;: {
  &quot;username&quot;: &quot;1234567890&quot;,
  &quot;password&quot;: &quot;1234567890&quot;,
  &quot;number&quot;: &quot;123456&quot;
  }
  }
  </code></pre>
  <p>Response Json :</p>
  <pre><code>{ &quot;httpResp&quot;: {
      &quot;status&quot;: &quot;Pass&quot;,
      &quot;message&quot;: &quot;great&quot;
      }
      }
  </code></pre>
  <p>Below was my code: If i am passing the json object below its working, but i need to send &quot;httpReq&quot; in json.</p>
  <pre><code>package main
  
  import (
      &quot;encoding/json&quot;
      &quot;fmt&quot;
  )
  
  
  type people struct {
      Username string `json:&quot;username&quot;`
      Password string `json:&quot;password&quot;`
      Number string `json:&quot;number&quot;`
      
  }
  
  type peopleread struct {
      Collection []people
  }
  
  func main() {
      text := `{
      &quot;username&quot;: &quot;1234567890&quot;,
      &quot;password&quot;: &quot;1234567890&quot;,
      &quot;number&quot;: &quot;123456&quot;
      
  }`
      textBytes := []byte(text)
  
      //people1 := people{}
      var people2 people
      err := json.Unmarshal(textBytes, &amp;people2)
      if err != nil {
          fmt.Println(err)
          return
      }
      Username := people2.Username
      Password := people2.Password
      Number := people2.Number
          fmt.Println(Username)
          fmt.Println(Password)
          fmt.Println(Number) 
  }
  </code></pre>