Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 如何在JSON中传递数组_Arrays_Json - Fatal编程技术网

Arrays 如何在JSON中传递数组

Arrays 如何在JSON中传递数组,arrays,json,Arrays,Json,我必须在下面的fornmat中传递json以进行API测试。我怎样才能做到呢?数组长度是动态的 { key1:"value", key2:"value2", key3:{ key4:[{ key5:"value5", key6:[{ key6:"value6[0]", key7:"value7[0]" }, { key6:"

我必须在下面的fornmat中传递json以进行API测试。我怎样才能做到呢?数组长度是动态的

   {
    key1:"value",
    key2:"value2",
    key3:{
      key4:[{
        key5:"value5",
        key6:[{
          key6:"value6[0]",
          key7:"value7[0]"
          },
          {
          key6:"value6[1]",
          key7:"value7[1]"
          }]
          }]
  }}

对于Java,您可以使用JSONObject和JSONArray来解析JSON字符串或为此结构创建POJO。这将取决于你的最终目标