Performs an HTTP POST on the given URI.

@param uri The URI to connect to.
@return The HTTP response as Response object.
@throws URISyntaxException
@throws UnsupportedEncodingException
@throws HttpException
552450
public static Response post(URI uri)
        throws URISyntaxException, UnsupportedEncodingException, HttpException {
        return postParams(new HttpPost(uri), new ArrayList<NameValuePair>(), null, null);
    }
83393
public static Response put(URI uri) throws URISyntaxException, HttpException {
        return putBody(new HttpPut(uri), null, null, null, null);
    }
1361326
public static String post(String url, Map<String, String> customHeaders, Map<String, String> params) throws IOException, HTTPException {
        LOGGER.log(Level.INFO, "Sending POST request to the url {0}", url);

        HttpPost httpPost = new HttpPost(url);

        populateHeaders(httpPost, customHeaders);

        if (params != null && params.size() > 0) {
            List<NameValuePair> nameValuePairs = new ArrayList<>();
            for (Map.Entry<String, String> param : params.entrySet()) {
                nameValuePairs.add(new BasicNameValuePair(param.getKey(), param.getValue()));
            }
            httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        }

        HttpClient httpClient = HttpClientBuilder.create().build();

        HttpResponse httpResponse = httpClient.execute(httpPost);

        int statusCode = httpResponse.getStatusLine().getStatusCode();
        if (isErrorStatus(statusCode)) {
            String jsonErrorResponse = EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8);
            throw new HTTPException(statusCode, httpResponse.getStatusLine().getReasonPhrase(), jsonErrorResponse);
        }

        return EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8);
    }
835181
def _post(self, uri, data, headers=None):
        
        if not headers:
            headers = self._get_headers()

        logging.debug("URI=" + str(uri))
        logging.debug("HEADERS=" + str(headers))
        logging.debug("BODY=" + str(data))

        response = self.session.post(uri, headers=headers,
                data=json.dumps(data))

        logging.debug("STATUS=" + str(response.status_code))
        if response.status_code in [200, 201]:
            return response.json()
        else:
            logging.error(b"ERROR=" + response.content)
            response.raise_for_status()
339534
@Override
	public <T extends Resource> T get(final String uri) {
		return doRequest(uri).get();
	}
241850
public static Post post(String uri, String content) {
        return post(uri, content.getBytes(), CONNECTION_TIMEOUT, READ_TIMEOUT);
    }
537780
@Override
	public <T extends Resource> T post(final String uri, final Map<String, String> params) throws UnsupportedEncodingException {
		return post(uri, new Parameters(unsafeCast(params)));
	}
76080
function(uri, data) {
      if (any(hook('posting', uri, data), haveStopped)) return
      var request = this.xhr()
      request.open('POST', uri, false)
      request.setRequestHeader('Content-Type', 'application/json')
      request.send(JSpec.JSON.encode(data))
    }
1043202
public static String post(String url, String body) {
        ExceptionUtil.notNull(url);
        return post(url, null, null, null, body, false);
    }
988874
public String doPost(String url, String body) throws IOException {
        HttpPost httpPost = new HttpPost(getWsapiUrl() + url);
        httpPost.setEntity(new StringEntity(body, "utf-8"));
        return doRequest(httpPost);
    }
1190085
public static Response put(String uriString, String username, String password) throws URISyntaxException, HttpException {
        return putBody(new HttpPut(uriString), null, null, new UsernamePasswordCredentials(username, password), null);
    }
8687
public static Response post(String url)
        throws URISyntaxException, UnsupportedEncodingException, HttpException {
        return postParams(new HttpPost(url), new ArrayList<NameValuePair>(), null, null);
    }
415066
public static Post post(String url, byte[] content, int connectTimeout, int readTimeout) {

        try {
            return new Post(url, content, connectTimeout, readTimeout);
        } catch (Exception e) {
            throw new HttpException("Failed URL: " + url, e);
        }
    }
1115562
protected function performRequest(string $uri)
    {
        $httpResponse = $this->client->get($uri);
        Assert::eq($httpResponse->getStatusCode(), 200, 'Request failed.');

        $content = $httpResponse->getBody()->getContents();
        $xml = simplexml_load_string($content);

        $this->exceptionOnError($xml);

        return $this->responseFactory->getResponse($xml);
    }
1233527
public static String getResponseAsString(URI uri, Header header) {
        return getResponseAsString(uri.toString(), header);
    }
1148080
public static URI urlToUri( URL url ) throws URISyntaxException {

		URI uri;
		try {
			// Possible failing step.
			uri = url.toURI();

		} catch( Exception e ) {
			// URL did not comply with RFC 2396 => illegal non-escaped characters.
			try {
				uri = new URI(
						url.getProtocol(),
						url.getUserInfo(),
						url.getHost(),
						url.getPort(),
						url.getPath(),
						url.getQuery(),
						url.getRef());

			} catch( Exception e1 ) {
				throw new URISyntaxException( String.valueOf( url ), "Broken URL." );
			}
		}

		uri = uri.normalize();
		return uri;
	}
697684
protected Optional<Response> executePostRequest(URI uri, Object obj, Map<String, Object> headers)
    {
        Invocation.Builder invocation = this.client.target(uri).request(MediaType.APPLICATION_JSON);
        applyHeaders(invocation, headers);
        Response response = invocation.post(Entity.entity(obj, MediaType.APPLICATION_JSON));
        handleResponseError("POST", uri, response);
        logResponse(uri, response);
        return Optional.of(response);
    }