src/SendsHttpRequestTrait.php
public function addBodyParam(string $name, $value, bool $overwrite = false)
    {
        $keyExists = array_key_exists($name, $this->body);
        # check if the key already exists
        if ($keyExists && !$overwrite) {
            return $this;
        }
        if (is_null($value)) {
            if ($keyExists) {
                unset($this->body[$name]);
            }
            return $this;
        }
        if (is_null($value)) {
            unset($this->query[$name]);
            return $this;
        }
        $this->body[$name] = $value;
        return $this;
    }
public function addBodyParam(string $name, $value, bool $overwrite = false)
    {
        $keyExists = array_key_exists($name, $this->body);
        # check if the key already exists
        if ($keyExists && !$overwrite) {
            return $this;
        }
        if (is_null($value)) {
            if ($keyExists) {
                unset($this->body[$name]);
            }
            return $this;
        }
        if (is_null($value)) {
            unset($this->query[$name]);
            return $this;
        }
        $this->body[$name] = $value;
        return $this;
    }
public function addBodyParam ( string $ name , $ value , bool $ overwrite = false ) { $ keyExists = array_key_exists ( $ name , $ this -> body ) ; # check if the key already exists if ( $ keyExists && ! $ overwrite ) { return $ this ; } if ( is_null ( $ value ) ) { if ( $ keyExists ) { unset ( $ this -> body [ $ name ] ) ; } return $ this ; } if ( is_null ( $ value ) ) { unset ( $ this -> query [ $ name ] ) ; return $ this ; } $ this -> body [ $ name ] = $ value ; return $ this ; }
Adds a parameter to the body of the request.

@param string $name
@param        $value
@param bool   $overwrite

@return $this
Adds a parameter to the body of the request .