多嵌套json字符串,根据key改value
多嵌套json字符串,根据key改value变量String accessToken = Bearer aaaa<pre><code class="language-javascript">```java
{
<span class="hljs-string">"config"</span>: {
<span class="hljs-string">"name"</span>: <span class="hljs-string">"testcase description"</span>
},
<span class="hljs-string">"teststeps"</span>: [
{
<span class="hljs-string">"name"</span>: <span class="hljs-string">""</span>,
<span class="hljs-string">"request"</span>: {
<span class="hljs-string">"method"</span>: <span class="hljs-string">"POST"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"xxxx"</span>,
<span class="hljs-string">"headers"</span>: {
<span class="hljs-string">"Accept"</span>: <span class="hljs-string">"*/*"</span>,
<span class="hljs-string">"Accept-Encoding"</span>: <span class="hljs-string">"gzip, deflate, br"</span>,
<span class="hljs-string">"Authorization"</span>: <span class="hljs-string">"Bearer bbbb"</span>,
<span class="hljs-string">"Connection"</span>: <span class="hljs-string">"keep-alive"</span>,
<span class="hljs-string">"Content-Length"</span>: <span class="hljs-string">"156"</span>,
<span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
<span class="hljs-string">"Host"</span>: <span class="hljs-string">"xxxx"</span>,
<span class="hljs-string">"Postman-Token"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"User-Agent"</span>: <span class="hljs-string">"PostmanRuntime/7.28.4"</span>
},
<span class="hljs-string">"cookies"</span>: {
<span class="hljs-string">"JSESSIONID"</span>: <span class="hljs-string">"xxxx"</span>
},
<span class="hljs-string">"body"</span>: {
<span class="hljs-string">"chunkCount"</span>: xx,
<span class="hljs-string">"fileMd5"</span>: <span class="hljs-string">"x"</span>,
<span class="hljs-string">"fileName"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"fileSize"</span>: xx,
<span class="hljs-string">"folderName"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"partNumber"</span>: x,
<span class="hljs-string">"uploadStatus"</span>: <span class="hljs-string">""</span>,
<span class="hljs-string">"userId"</span>: <span class="hljs-string">"xxx"</span>
}
},
<span class="hljs-string">"validate"</span>: [
{
<span class="hljs-string">"check"</span>: <span class="hljs-string">"status_code"</span>,
</code></pre>
可以的 只要能够定位到key就可以修改对应的value值的。 定位就行
页:
[1]