src/Client.php
public function put($key, $value, array $options = [])
    {
        $params = [
            'key' => $key,
            'value' => $value,
        ];

        $params = $this->encode($params);
        $options = $this->encode($options);
        $body = $this->request(self::URI_PUT, $params, $options);
        $body = $this->decodeBodyForFields(
            $body,
            'prev_kv',
            ['key', 'value',]
        );

        if (isset($body['prev_kv']) && $this->pretty) {
            return $this->convertFields($body['prev_kv']);
        }

        return $body;
    }
public function put($key, $value, array $options = [])
    {
        $params = [
            'key' => $key,
            'value' => $value,
        ];

        $params = $this->encode($params);
        $options = $this->encode($options);
        $body = $this->request(self::URI_PUT, $params, $options);
        $body = $this->decodeBodyForFields(
            $body,
            'prev_kv',
            ['key', 'value',]
        );

        if (isset($body['prev_kv']) && $this->pretty) {
            return $this->convertFields($body['prev_kv']);
        }

        return $body;
    }
public function put ( $ key , $ value , array $ options = [ ] ) { $ params = [ 'key' => $ key , 'value' => $ value , ] ; $ params = $ this -> encode ( $ params ) ; $ options = $ this -> encode ( $ options ) ; $ body = $ this -> request ( self :: URI_PUT , $ params , $ options ) ; $ body = $ this -> decodeBodyForFields ( $ body , 'prev_kv' , [ 'key' , 'value' , ] ) ; if ( isset ( $ body [ 'prev_kv' ] ) && $ this -> pretty ) { return $ this -> convertFields ( $ body [ 'prev_kv' ] ) ; } return $ body ; }
Put puts the given key into the key-value store.
A put request increments the revision of the key-value
store\nand generates one event in the event history.

@param string $key
@param string $value
@param array  $options 可选参数
int64  lease
bool   prev_kv
bool   ignore_value
bool   ignore_lease
@return array
@throws \GuzzleHttp\Exception\BadResponseException
Put puts the given key into the key - value store . A put request increments the revision of the key - value store \ nand generates one event in the event history .