post()

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2013-03-11
488850
public function post()
    {
        // Create Vendor Journal
        $vendorJournal = new InvoiceJournal($this);
        $vendorJournal->debit($this->getVendor()->getAccountsReceivableAccount(), $this->getAmount());
        $vendorJournal->credit($this->getVendor()->getSalesAccount(), $this->getAmount());

        // Add Vendor Journal to Invoice
        $this->addJournal($vendorJournal);

        // Create Customer Journal
        $customerJournal = new InvoiceJournal($this);
        $customerJournal->debit($this->getCustomer()->getAccountsPayableAccount(), $this->getAmount());
        $customerJournal->credit($this->getCustomer()->getPurchasesAccount(), $this->getAmount());

        // Add Customer Journal to Invoice
        $this->addJournal($customerJournal);

        parent::post();
    }
1355147
public function post()
    {
        $this->setPostedAt(new \DateTime());

        $this->ensureZeroSumOfPostings();

        foreach ($this->getPostings() as $posting) {
            $posting->post();
        }
    }
1173592
def post(self, user_ids=None, usernames=None, status=None):
        
        return self.connection.post('user/array',
                                    data=dict(user_ids=user_ids,
                                              usernames=usernames,
                                              status=status))
192710
public function post($params = array(), $options = array())
        {
            // If its an array (instead of a query string) then format it correctly
            if (Array::isArray($params)) {
                $params = http_build_query($params, null, '&');
            }

            // Add in the specific options provided
            $this->options($options);

            $this->http_method('post');

            $this->option(CURLOPT_POST, true);
            $this->option(CURLOPT_POSTFIELDS, $params);
        }
1215363
protected function _sendPost() {
		if (isset($this->_curl_options[CURLOPT_HTTPHEADER])) {
			$old_httpheader = $this->_curl_options[CURLOPT_HTTPHEADER];
		}
		foreach ($this->_post as $url => $data) {
			$this->_setHTML($url);
			$postfields = array();
			foreach ($data as $name => $value) {
				if (is_array($value)) {
					$result = $this->_filter($value[0], $this->_html, 1, $name);
					$postfields[] = $name.'='.$result;
				} else {
					$postfields[] = $name.'='.$value;
				}
			}
			$postfields = implode('&', $postfields);
			$httpheader = array(
				'X-CSRF-Token: '.$result,
				'Content-Length: '.strlen($postfields),
				'Connection: Keep-Alive',
				'Keep-Alive: 300',
			);
			if (isset($old_httpheader)) {
				$httpheader = array_merge($httpheader, $old_httpheader);
			}
			$this->setCURL(array(
				CURLOPT_POST => 1,
				CURLOPT_POSTFIELDS => $postfields,
				CURLOPT_HTTPHEADER => $httpheader,
			));
			$this->_setHTML($url);
		}
		unset($this->_curl_options[CURLOPT_POST]);
		unset($this->_curl_options[CURLOPT_POSTFIELDS]);
		if (isset($old_httpheader)) {
			$this->_curl_options[CURLOPT_HTTPHEADER] = $old_httpheader;
		}
	}
1121321
function post($path = null, $postBody = null, $headers = null, $curlOpts = null) {
        $payload = $this -> encodePostBody($postBody);
        $this -> log -> debug("\n\n ====== Dump the payload before Http POST send! ====== \n\n$payload\n\n====== End Dump! ======\n");
        return $this -> request($path, self::HTTP_POST, $payload, $headers, $curlOpts);
    }
737808
protected function putToPost(): void
    {
        $request = $this->requestStack->getCurrentRequest();
        $put = $request->getContent();
        parse_str($put, $_POST);

        $_SERVER['REQUEST_METHOD'] = 'POST';
    }
626008
public function post($key = null, $default = null)
	{
		if ( is_null($key) )
		{
			return $this->post;
		}

		return Arr::get($this->post, $key, $default);
	}
83346
function post($path, $body, $contentType = null)
    {
        return $this->dispatchRequest(
            $this->buildRequest('POST', $path, $body, $contentType)
        );
    }
673020
protected function _post()
    {
        $subject = $this->_subject();

        $this->_trigger('beforeLogin', $subject);

        if ($user = $this->_controller()->Auth->identify()) {
            return $this->_success($subject, $user);
        }

        $this->_error($subject);
    }
695130
protected function _post($fields = [], $slug = '')
    {
        //Build the form data
        $data = $this->orm->uniBody->Form($fields);
        // Build a url from the slug that was passed in
        $url = $this->urlFromRoute($slug);
        // Send a post request to the API
        $response = $this->orm->uniRequest->post($url, $this->orm->headers, $data);
        // If the token has expired
        if ($response->code == 401) {
            if (isset($response->body->message)) {
                if ($response->body->message == 'Token has expired') {
                    // Authenticate again
                    $this->orm->authenticate();
                    // Try the request again
                    return $this->_post($fields, $slug);
                }
            }
            // Return the response
            return $response;
        } else {
            // Return the response
            return $response;
        }
    }
1019335
public function post(string $pattern, array $param) : void
    {
        $this->call('post', $pattern, $param[0], $param[1], $param);
    }
850169
def _post(self, url, params, uploads=None):
        
        self._call(self.POST, url, params, uploads)
784590
def post(self, path, **kwargs):
        ''''''
        resp = self._session.post(self._url(path), **self._builder(**kwargs))
        if 'stream' in kwargs:
            return resp
        else:
            return self._resp_error_check(resp)
1289656
public function post($key = null, $default = null)
    {
        $posts = $this->getPostParams();

        return is_null($key) ? $posts : data_get($posts, $key, $default);
    }
582102
public function setDataFromPost() {
    // Recorremos el arreglo $data
    foreach ($this->data as $key => $value) {
      // Si existe la llave en $_POST entonces asignamos su valor
      // a $data
      if (isset($_POST[$key])) {
        $this->data[$key] = $_POST[$key];
      }
    }
  }
335964
def post(self):
        
        # type(data) = dict
        data = json.loads(self.request.body.decode())
        # type(method) = str
        method = data["method"]
        # type(params) = dict
        params = data["params"]
        if method == "sendmail":
            response = dispatch([sendmail],{'jsonrpc': '2.0', 'method': 'sendmail', 'params': [params], 'id': 1})
            #self.write(response)
        else:
            pass