简体   繁体   中英

How to update json field in Firebase DB with JMeter HTTP Request

I'm working with JMeter to make some HTTP Requests to my Firebase Database. I am able to create json data with a regular request, as well as with a CSV file. I'm wondering if it's possible to update, or add to, a json object.

My json data looks something like what is below. Let's say I wanted to add a boolean node called "sold", to which I could make equal to true or false. Could I create it within that json object? If so, could I also make it so that only fields with a specific "name" get updated?

{
"Price": "5.00",
"name": "buyer@gmail.com",
"seller_name": "seller@gmail.com",
"time": 1496893589683,
}

Looking into Updating Data with PATCH chapter of Saving Data article you can update a single field using HTTP PATCH Method .

JMeter supports HTTP PATCH method since version 2.8 so you should be in a position to use it as well in your test.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM