src/Peru/Http/ContextClient.php
public function post(string $url, $data, array $headers = [])
    {
        if (is_array($data)) {
            $headers['Content-type'] = self::FORM_CONTENT_TYPE;
        }

        $ctx = $this->getContext('POST', $data, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
public function post(string $url, $data, array $headers = [])
    {
        if (is_array($data)) {
            $headers['Content-type'] = self::FORM_CONTENT_TYPE;
        }

        $ctx = $this->getContext('POST', $data, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
public function post ( string $ url , $ data , array $ headers = [ ] ) { if ( is_array ( $ data ) ) { $ headers [ 'Content-type' ] = self :: FORM_CONTENT_TYPE ; } $ ctx = $ this -> getContext ( 'POST' , $ data , $ headers ) ; $ response = file_get_contents ( $ url , false , $ ctx ) ; $ this -> saveCookies ( $ http_response_header ) ; return $ response ; }
Post Request.

@param string $url
@param mixed  $data
@param array  $headers

@return string|false
Post Request .