public function post($inRequestUri, $inPostParameters=[]) {

        // Prepare the content of the request's body.
        $bodyContent = [];
        foreach ($inPostParameters as $_name => $_value) {
            $bodyContent[] = $_name . '=' . urlencode($_value);
        }
        $bodyContent = implode('&', $bodyContent);

        // Prepare the request's headers.
        if (! array_key_exists('Content-Type', $this->__httpHeaders)) {
            $this->__httpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
        }
        if (! array_key_exists('Content-Length', $this->__httpHeaders)) {
            $this->__httpHeaders['Content-Length'] = strlen($bodyContent);
        }

        return $this->request('POST', $inRequestUri, '', $bodyContent);
    }
public function post($inRequestUri, $inPostParameters=[]) {

        // Prepare the content of the request's body.
        $bodyContent = [];
        foreach ($inPostParameters as $_name => $_value) {
            $bodyContent[] = $_name . '=' . urlencode($_value);
        }
        $bodyContent = implode('&', $bodyContent);

        // Prepare the request's headers.
        if (! array_key_exists('Content-Type', $this->__httpHeaders)) {
            $this->__httpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
        }
        if (! array_key_exists('Content-Length', $this->__httpHeaders)) {
            $this->__httpHeaders['Content-Length'] = strlen($bodyContent);
        }

        return $this->request('POST', $inRequestUri, '', $bodyContent);
    }
public function post ( $ inRequestUri , $ inPostParameters = [ ] ) { // Prepare the content of the request's body. $ bodyContent = [ ] ; foreach ( $ inPostParameters as $ _name => $ _value ) { $ bodyContent [ ] = $ _name . '=' . urlencode ( $ _value ) ; } $ bodyContent = implode ( '&' , $ bodyContent ) ; // Prepare the request's headers. if ( ! array_key_exists ( 'Content-Type' , $ this -> __httpHeaders ) ) { $ this -> __httpHeaders [ 'Content-Type' ] = 'application/x-www-form-urlencoded' ; } if ( ! array_key_exists ( 'Content-Length' , $ this -> __httpHeaders ) ) { $ this -> __httpHeaders [ 'Content-Length' ] = strlen ( $ bodyContent ) ; } return $ this -> request ( 'POST' , $ inRequestUri , '' , $ bodyContent ) ; }
Execute a POST request.

@param string $inRequestUri The request URI (example: "/hello/toto").
@param array $inPostParameters List of parameters to pass.
@return string The content of the standard output.
@see \Slim\Http\Request::getParsedBody for a detailed description of how the request body is parsed.
The parsing relies on the value of the 'Content-Type' header.
It should be "application/x-www-form-urlencoded".
@note Please keep in mind that:
- HTTP headers can be configured through the method SoftRequester::setHttpHeaders().
- Server CGI environment variables can be configured through the method SoftRequester::setServerCgiEnvironmentVariables().
@see Requester::setHttpHeaders()
@see Requester::setServerCgiEnvironmentVariables()
Execute a POST request .