:nocov:
 Execute an HTTP POST request to the given URL

 @param [String] url
 @param [Hash] data  Key/Value pairs to POST
 @return [String] Contents of the response's body
337846
def http_post(url, data)
    req = HTTPI::Request.new(:url => url, :body => data)
    return HTTPI.post(req).body
  end
752514
def _http_response(self, url, method, data=None, **kwargs):
        
        header = {'content-type': 'application/json'}

        if data:
            data = json.dumps(data)
        path = url.format(**kwargs)
        logger.debug("%s %s", method.__name__.upper(), path)
        response = method(self.host + path,
                          data=data, headers=header, **self.method_kwargs)
        logger.debug("%s %s", response.status_code, response.reason)
        response.raise_for_status()

        return response
673677
def post(query_url,
             headers: {},
             parameters: {})
      HttpRequest.new(HttpMethodEnum::POST,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end
951745
def request(self, url, method="get", format="json", data=None,
                expected_status=None, headers=None, use_xpost=True, **options):
        
        if expected_status is None:
            if method == "get":
                expected_status = 200
            elif method == "post":
                expected_status = 201
            else:
                raise ValueError("No expected status supplied and method unknown.")

        if not url.startswith("http"):
            url = "{self.host}/api/v4/{url}".format(**locals())
        if format is not None:
            options = dict({'format': format}, **options)
        options = {field: value for field, value in options.items() if value is not None}
        headers = dict(headers or {}, Authorization="Token {}".format(self.token))
        #headers['Accept-encoding'] = 'gzip'

        if method == "get" and use_xpost:
            # If method is purely GET, we can use X-HTTP-METHOD-OVERRIDE to send our
            # query via POST. This allows for a large number of parameters to be supplied
            assert(data is None)

            headers.update({"X-HTTP-METHOD-OVERRIDE": method})
            data = options
            options = None
            method = "post"

        r = requests.request(method, url, data=data, params=options, headers=headers)

        log.debug(
            "HTTP {method} {url} (options={options!r}, data={data!r},"
            "headers={headers}) -> {r.status_code}".format(**locals())
        )
        return check(r, expected_status=expected_status)
813704
def build_request_body(header_params, form_params, body)
      # http form
      if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
          header_params['Content-Type'] == 'multipart/form-data'
        data = {}
        form_params.each do |key, value|
          case value
          when ::File
            data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
          when ::Array, nil
            data[key] = value
          else
            data[key] = value.to_s
          end
        end
      elsif body
        data = body.is_a?(String) ? body : body.to_json
      else
        data = nil
      end
      data
    end
1139827
def _post(url:str, params:dict, headers:dict) -> dict:
    
    response = requests.post(url, params=params, headers=headers)
    data = response.json()
    if response.status_code != 200 or "error" in data:
        raise GoogleApiError({"status_code": response.status_code,
                                  "error": data.get("error", "")})
    return data
858441
def _post(self, url, data=None, **kwargs):
        

        # Remove non-ASCII characters from filenames due to a limitation of the combination of
        # urllib3 (via python-requests) and our server
        # https://github.com/requests/requests/issues/2117
        # Internal Ticket #3090
        if "files" in kwargs and kwargs["files"] is not None:
            acceptable_chars = "0123456789" + "abcdefghijklmnopqrstuvwxyz" + \
                               "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + " _-.,()[]{}"
            for param_name, fp in kwargs["files"].items():
                if isinstance(fp, (tuple, list)):
                    filename, fp = fp
                else:
                    filename = requests.utils.guess_filename(fp) or param_name

                def encode(char):
                    try:
                        if char in acceptable_chars:
                            return char
                    except UnicodeDecodeError:
                        pass
                    return "x{:02x}".format(ord(char))
                filename = "".join(encode(x) for x in filename)

                kwargs["files"][param_name] = (filename, fp)

        for i in itertools.count(1):
            try:
                return self.session.post(url, data=data, timeout=self.timeout, **kwargs)
            except requests.exceptions.Timeout as e:
                # exhausted all retries
                if i >= self.retries:
                    raise ConnectionError(e)
            except requests.exceptions.RequestException as e:
                raise ConnectionError(e)

            # exponential backoff
            max_backoff = 4 ** i / 10   # .4, 1.6, 6.4, 25.6, ...
            time.sleep(random.uniform(0, max_backoff))
772015
public static function postRequest($url, $data)
    {
        $url = str_replace("&amp;", "&", urldecode(trim($url)));

        $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data)));
        $context = stream_context_create($options);

        try {
            $data = @file_get_contents($url, false, $context);
            return $data;
        } catch (\Exception $e) {
            return false;
        }
    }
978259
def post(self, url, data, params=None):
        
        r = self.session.post(url, data=data, params=params)
        return self._response_parser(r, expect_json=False)
954722
def post(body, path=nil)
      if header["Content-Type"] =~ /application\/(\w+[+])?json/
         chunk_save(path, "POST", body, param, header)
      else
        execute(
          request(path, :post, body, param, header)
        )
      end
    end
444767
def post_ssl(address, data={})
      uri = URI.parse(address)
      data["nonce"] = get_nonce

      begin
        req = Net::HTTP::Post.new(uri)
        req.set_form_data(data)
        req["Key"] = @api_key
        req["Sign"] = get_sign(req)

        https = initialize_https(uri)
        https.start {|w|
          response = w.request(req)
          case response
            when Net::HTTPSuccess
              json = JSON.parse(response.body)
              raise JSONException, response.body if json == nil
              return json
            else
              raise ConnectionFailedException, "Failed to connect to #{@name}: " + response.value
          end
        }
      rescue
        raise
      end
    end
137429
def fpost(self, url, form_data):
        
        response = None

        if 'files' in form_data:
            response = requests.post(
                self.host + url,
                data=form_data['data'] if 'data' in form_data else {},
                files=form_data['files'] if 'files' in form_data else {},
                headers={
                    'Authorization': 'Bearer ' + self.token,
                    'x-falkonry-source':self.sourceHeader
                },
                verify=False
            )
        else:
            response = requests.post(
                self.host + url,
                data=json.dumps(form_data['data'] if 'data' in form_data else {}),
                headers={
                    'Content-Type': 'application/json',
                    'Authorization': 'Bearer ' + self.token,
                    'x-falkonry-source':self.sourceHeader
                },
                verify=False
            )
        if response.status_code == 201 or response.status_code == 202:
            try:
                return json.loads(response._content.decode('utf-8'))
            except Exception as e:
                return json.loads(response.content)
        elif response.status_code == 401:
            raise Exception(json.dumps({'message':'Unauthorized Access'}))
        else:
            raise Exception(response.content)
1332881
def request(cls, method, url, **kwargs):
		
		methodupper = method.upper()
		hasdata = 'data' in kwargs
		if methodupper == 'GET':
			if hasdata:
				print("ERROR: Can't do HTTP GET when the 'data' parameter presents")
				assert False
			resp = ulr.urlopen(url, **kwargs)
		elif methodupper == 'POST':
			if hasdata:
				resp = ulr.urlopen(url, **kwargs)
			else:
				resp = ulr.urlopen(url, data = '', **kwargs)
		else:
			raise NotImplementedError()

		return resp
37170
public RFuture<String> post(String url, String data) {
    return req(url).setPayload(data).execute().map(GET_PAYLOAD);
  }
684466
def http_post_download(url, data, dest)
    File.open(dest, "w") do |io|
      req = HTTPI::Request.new(:url => url, :body => data)
      req.on_body { |d| io << d; d.length }
      HTTPI.post(req)
    end
    true
  end
930237
def doWebRequest(url, method="GET", data=None, headers={}):
    

    # Initialize variables
    response = None
    content = None
    # Find condition that matches request
    if method == "HEAD":
        request = HEADREQUEST(url, data=data, headers=headers)
    elif method == "PUT":
        request = PUTREQUEST(url, data=data, headers=headers)
    elif method == "DELETE":
        request = DELETEREQUEST(url, headers=headers)
    elif method == "GET":
        request = urllib2.Request(url, headers=headers)
    # POST?
    else:
        request = urllib2.Request(url, data=data, headers=headers)
    response = urllib2.urlopen(request)
    if response:
        content = response.read()
    return response, content
1245175
function post($url, $data, $callback = null)
    {
        $ret = new CoURLResult($url, $callback, $this->handle);
        $ret->method = self::METHOD_POST;
        $ret->data = $data;
        $this->requests[$ret->id] = $ret;
        return $ret;
    }