sends the message via post request ['message'] to the url
@param string $url the url
@param the PBMessage class where the request should be encoded

@return String - the return string from the request to the url
354813
public function send($url, &$class = null)
    {
        $ch = curl_init();
        $this->dString = '';

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_WRITEFUNCTION, array($this, 'saveString'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, 'message=' . urlencode($this->serializeToString()));
        $result = curl_exec($ch);

        if ($class !== null && method_exists($class, 'parseFromString')) {
            $class->parseFromString($this->dString);
        }
        return $this->dString;
    }
338311
protected function exec($url)
    {
        $client = $this->getRequest();
        $response = $client->request('GET',$url);
        return $this->handleResponse($response->getBody());
    }
808047
public function request($url)
    {
        $curlOpts = array_replace($this->curlOpts, [CURLOPT_URL => $url]);

        $ch = curl_init();
        foreach ($curlOpts as $opt => $optVal) {
            curl_setopt($ch, $opt, $optVal);
        }

        $resp = curl_exec($ch);
        $info = (object) curl_getinfo($ch);
        curl_close($ch);

        //Check response
        $httpCode = (string) $info->http_code;
        if ($httpCode{0} != '2') {
            $msg = sprintf('HTTP Request Failed (code %s): %s', $info->http_code, $resp);
            throw new HttpException($resp, $msg, $httpCode);
        } elseif (strlen(trim($resp)) == 0) {
            throw new HttpException($resp, 'HTTP Response Empty');
        }

        return $resp;
    }
1609
def send_message(url, message):
    '''
    
    '''
    headers = {'Content-Type': 'application/json'}
    data = {'text': message}
    result = __utils__['http.query'](url,
                                     'POST',
                                     data=json.dumps(data),
                                     header_dict=headers,
                                     decode=True,
                                     status=True)

    if result.get('status', 0) == 200:
        return True
    else:
        return False
1249548
public function put(string $url, array $params = [])
    {
        return $this->send('PUT', $url, [
            $this->bodyFormat => $params,
        ]);
    }
662965
public function setDeliveryReceiptNotificationUrl($url, $sender = null)
    {
        return $this->client->executeRequest(
            new SMSDRRegisterCallbackRequest($url, $sender ?: $this->senderNumber)
        );
    }
1280721
protected function send($url, array $params)
    {
        $success = false;

        $rawResponse = $this->client->get($url.'?'.http_build_query($params), [
            'exceptions'      => false,
            'timeout'         => '80',
            'connect_timeout' => '30',
            'headers'         => [
                'Accept'       => 'application/xml',
                'Content-Type' => 'application/x-www-form-urlencoded',
            ],
        ]);

        if ($rawResponse->getStatusCode() == 200) {
            $success = false;
            $response = $this->parse($rawResponse->getBody());

            if (isset($response->error)) {
                $response = $this->responseError($rawResponse);
            } else {
                $success = $response->response->attributes()->type == 'status';
            }
        } else {
            $response = $this->responseError($rawResponse);
        }

        return $this->mapResponse($success, $response);
    }
1031814
public function post($url, $params = [])
    {
        $req = $url instanceof Request ? $url : $this->buildRequest('POST', $url);
        foreach ($params as $key => $value) {
            $req->addPostField($key, $value);
        }
        return $this->exec($req);
    }
547942
public function post($url, $parameters = [])
    {
        $url = static::LOCATION.$url;
        $headers = $this->buildHeaders();

        $request = $this->requestProvider->createRequest('POST', $url, $headers, json_encode($parameters));
        $response = $this->client->send($request);

        $this->errorCheckResponse($response);

        return json_decode($this->streamToString($response->getBody()));
    }
743236
public static function resolveHttp($url = null)
    {
        if (is_null($url)) {
            return '';
        }
        $url = preg_replace(',^feed://,i', 'http://', $url);
        if (!preg_match(',^[a-z]+://,i', $url)) {
            $url = 'http://'.$url;
        }
        return $url;
    }
449028
public function setURL($url = '')
    {
        try {
            if (mb_strlen($url) > 0) {
                if (substr($url, 0, 8) == 'https://') {
                    $this->isSSL = TRUE;
                    $this->debug->debug(__FUNCTION__, 'Set SSL: ' . $this->isSSL);
                } elseif (substr($url, 0, 7) == 'http://') {
                    $this->isSSL = TRUE;
                    $this->debug->debug(__FUNCTION__, 'Set SSL: ' . $this->isSSL);
                }
            }
            $this->url = $url;
        }
        catch (Exception $e) {
            $this->url = NULL;
            $message   = "Error: " . __CLASS__ . ": Invalid protocol specified. URL must start with http:// or https:// - " . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
        $this->debug->debug(__FUNCTION__, 'Endpoint URL to Request: ', $this->url);

        return $this;
    }
711777
public function sendLinkMsg($title, $text, $picUrl = '', $messageUrl)
    {
        $query = [
            'msgtype' => 'link',
            'link' => [
                'title' => $title,
                'text' => $text,
                'picUrl' => $picUrl,
                'messageUrl' => $messageUrl
            ],
        ];
        return $this->sendMsg($query);
    }
538212
public function post(string $url, array $params = [])
    {
        return $this->send('POST', $url, [
            $this->bodyFormat => $params,
        ]);
    }
120252
protected function _sendRawPost($url, $rawPost, $contentType = 'text/xml; charset=UTF-8')
    {
        $initializeRequest = function(Request $request) use ($rawPost, $contentType) {
            $request->setRawData($rawPost);
            $request->addHeader('Content-Type: ' . $contentType);
            return $request;
        };

        return $this->_sendRawRequest($url, Request::METHOD_POST, $rawPost, $initializeRequest);
    }
1367644
public function post($url, $body)
    {
        $this->addHeader('Content-Type', $this->getContentType());

        if (!is_string($body)) {
            $body = json_encode($body);
        }

        $this->initializeRequest();

        curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'POST');
        curl_setopt($this->curl, CURLOPT_URL, $url);
        curl_setopt($this->curl, CURLOPT_POST, true);
        curl_setopt($this->curl, CURLOPT_PUT, false);
        curl_setopt($this->curl, CURLOPT_HTTPGET, false);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        curl_exec($this->curl);

        return $this->handleResponse();
    }
1135497
public static function call($url)
    {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
        curl_setopt($ch, CURLOPT_TIMEOUT, 45);

        $result = curl_exec($ch);

        if (! $result) {
            throw new \Exception(sprintf('The endpoint "%s" is not returning anything.', $url));
        }

        return simplexml_load_string($result);
    }
1283892
protected function exec($url)
    {
        $client = $this->getRequest();
        try{
            $response = $client->request('POST',$this->buildRequestUrl(),[
                'json' => [
                    'longUrl' => $url
                ]
            ]);
        } catch (\GuzzleHttp\Exception\ClientException $e){
            $response = $e->getResponse();
        }
        return $this->handleResponse($response->getBody());
    }